Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
EXTRACT MONTH FROM DATE | New Users to Excel | |||
Extract Date | Excel Worksheet Functions | |||
extract name when a date in another cell gets near | Excel Discussion (Misc queries) | |||
extract date from the most current date | Excel Discussion (Misc queries) | |||
Extract date from cell | Excel Worksheet Functions |