I'm extremely new at VBA, however using google and in particular stackoverflow I have developed some reasonable skills in VBA and managed to accomplish a lot in no more than two weeks.
I'm trying to get VBA script to paste a formula down column A
from cell 2, the formula currently used is =TEXT(H2,"ddmmyy")&LEFT(B2,1)&C2
I have tried several different ways but get syntax errors and compile errors. My latest attempt is as follows.
Sub FillDown()
Dim strFormulas(1 To 1) As Variant
With ThisWorkbook.Sheets("Sheet1")
strFormulas(1) = "=TEXT(H2,"ddmmyy")&LEFT(B2,1)&C2"
.Range("C2:E2").Formula = strFormulas
.Range("C2:E11").FillDown
End With
End Sub
I get an error on the "ddmmyy" (compile error: Syntax error) , it takes the numbers and places them in front of someone's name to create unique ID's. I apologise as this might be a bad question, but I'm fairly new and achieved and learnt so much already, and I want to keep learnings VBA at FANTASTIC pace.