Re: Assigning a formula to a variable inside VBA
Solution that StephenR sent is easiest way to solve my problem. Code is as follows:
Code
Sub Copy_ID()
'
' Copy_ID Macro
Dim counter As Long
counter = WorksheetFunction.CountA(Sheets("Counter").Range("A:A"))
Range("A2").FormulaR1C1 = "=LEFT('Counter'!RC2,5)"
Range("A2").AutoFill Destination:=Range("A2:A" & counter)
End Sub
Thank you StephenR!