Hello
I'm trying to write my first macro for excel in VBA.
I recorded a macro and now I'm trying tu costumize it.
I have problem with ActiveCell.Formula
I'm trying to write a formula in a cell.
When I record a macro I get
ActiveCell.Formula="=Page1!B1" and it works
but I want to define formula which is depended on one number.
I tried this:
Public Type spremenljivke
number1 As Integer
variable1 As String
End Type
Sub Macro1()
......
number1=1
variable1="Page1!B1"+Str(number1)
ActiveCell.Formula=variable1
......
End Sub
But this not working
Can anyone help me?
Bob
I'm trying to write my first macro for excel in VBA.
I recorded a macro and now I'm trying tu costumize it.
I have problem with ActiveCell.Formula
I'm trying to write a formula in a cell.
When I record a macro I get
ActiveCell.Formula="=Page1!B1" and it works
but I want to define formula which is depended on one number.
I tried this:
Public Type spremenljivke
number1 As Integer
variable1 As String
End Type
Sub Macro1()
......
number1=1
variable1="Page1!B1"+Str(number1)
ActiveCell.Formula=variable1
......
End Sub
But this not working
Can anyone help me?
Bob