U
u473
I want to populate a Month Column (with the format YMM) from the
adjacent Date column,
through a loop which would translate a date like 8/15/2007 to 708.
The Excel formula is Year(DateField)*100+Month(Datefield)-200000
Now , I want to incorporate this logic in my loop code, and for good
measure, add an IsDate test.
I am still a newbie. I tried to get the help of the Macro Recorder,
but I am stuck.
Can you help me with this code ?. Thank you.
Dim RowNdx As Long: Dim LastRow As Long: LastRow =
ActiveSheet.UsedRange.Rows.Count
For RowNdx = LastRow To 2 Step -1
If IsDate(Cells(RowNdx, "Z").Value) Then
Cells(RowNdx, "Y").Value = "=YEAR((Cells(RowNdx,
'Z').Value)*100+MONTH((Cells (RowNdx, 'Z').Value)-200000"
Next RowNdx
Celeste
adjacent Date column,
through a loop which would translate a date like 8/15/2007 to 708.
The Excel formula is Year(DateField)*100+Month(Datefield)-200000
Now , I want to incorporate this logic in my loop code, and for good
measure, add an IsDate test.
I am still a newbie. I tried to get the help of the Macro Recorder,
but I am stuck.
Can you help me with this code ?. Thank you.
Dim RowNdx As Long: Dim LastRow As Long: LastRow =
ActiveSheet.UsedRange.Rows.Count
For RowNdx = LastRow To 2 Step -1
If IsDate(Cells(RowNdx, "Z").Value) Then
Cells(RowNdx, "Y").Value = "=YEAR((Cells(RowNdx,
'Z').Value)*100+MONTH((Cells (RowNdx, 'Z').Value)-200000"
Next RowNdx
Celeste