I am looking to insert Formula in Column "G" =Text(A3, 'mmmm") so that it updates each cell with Month based on date/time in column A.
xcWks.Range("G" & rCount).Formula = "=TEXT("A"& rCount, mmmm)"
I am looking to insert Formula in Column "G" =Text(A3, 'mmmm") so that it updates each cell with Month based on date/time in column A.
xcWks.Range("G" & rCount).Formula = "=TEXT("A"& rCount, mmmm)"
You want to use
xcWks.Range("G" & rCount).Formula = "=TEXT(A" & rCount & ",""mmmm"")"
which will generate the following formula if rCount
was, for instance, 3
:
=TEXT(A3,"mmmm")
As stated in question
I am looking to insert Formula in Column "G"
I am assuming you want to enter formula in Column G
, thus try
Dim lastRow As Long
lastRow = xcWks.Range("A" & xcWks.Rows.Count).End(xlUp).Row 'get last row with data using Colunm A
xcWks.Range("G2:G" & lastRow).Formula = "=TEXT(A2,""mmmm"")"
Thanks so much guys. I had an counter "intRow" defined earlier in my code which i used along with rCount and it worked like a charm.
excWks.Cells(intRow, 7).Formula = "=TEXT(A" & rCount & ",""mmmm"")"