Concatenate address in VBA Excel Range Object

Asked

Viewed 1,822 times

2

I need to concatenate an address in the Excel Range Object and I’m not getting it. The value is an Integer variable. Follow the line of code:

Range("O10").Formula = "=SUM(O12:O" & "valor)"

1 answer

3


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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.