G
Guest
Hi,
I am currently working on writing my first VBA program, but am having
trouble determing how to reference a value in the active cell of the
worksheet. I want the value in the active cell to be passed to
"TimeBlocks"-- which will then tell the computer the # of times to loop
through the statement.
Any help would be greatly appreciated.
Thanks,
Liz
This is what i have so far:
Sub Macro3()
'
' Macro3 Macro
'
'
Dim counter As Integer
Dim TimeBlocks As Integer
Set TimeBlocks = ActiveCell.Value
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveCell.FormulaR1C1 = "v"
For counter = 1 To TimeBlocks
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "v"
Next counter
End Sub
I am currently working on writing my first VBA program, but am having
trouble determing how to reference a value in the active cell of the
worksheet. I want the value in the active cell to be passed to
"TimeBlocks"-- which will then tell the computer the # of times to loop
through the statement.
Any help would be greatly appreciated.
Thanks,
Liz
This is what i have so far:
Sub Macro3()
'
' Macro3 Macro
'
'
Dim counter As Integer
Dim TimeBlocks As Integer
Set TimeBlocks = ActiveCell.Value
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveCell.FormulaR1C1 = "v"
For counter = 1 To TimeBlocks
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "v"
Next counter
End Sub