Concatenate address in Excel VBA Range Object

2

I need to concatenate an address in the Range Object of Excel and I can not. The value is an integer variable. Here's the line of code:

Range("O10").Formula = "=SUM(O12:O" & "valor)"
    
asked by anonymous 10.02.2015 / 12:14

1 answer

3
Public Sub Teste()
  Dim Valor As Integer
  Valor = 3000
  Range("A1").Formula = "=SUM(D1:D" & Valor & ")"
End Sub
    
10.02.2015 / 12:42