XL2002 SP3 on XP Pro SP2
In my spreadsheet (one of many) I have a table consisting of dates in column A (in the format dd/mm/yyyy) which represent the first of each month, plus other data in columns B:D.
When the section of my VBA macro reaches the CELLS.FIND line, the active cell is always in the row immediately above the start of my table. The VBA code was originally generated using the macro recorder, so I know that when I used the EDIT/FIND function, the active cell became the cell containing the month I had entered.
In the VBA code I determine the date using the following statement...
rfld = "01/" & Mid("0" & Month(Now()) + 1, Len(Month(Now())), 2) & "/" & Year(Now())
...and use the variable in the cells.find code that follwos ...
Cells.Find(What:=rfld, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
In my spreadsheet (one of many) I have a table consisting of dates in column A (in the format dd/mm/yyyy) which represent the first of each month, plus other data in columns B:D.
When the section of my VBA macro reaches the CELLS.FIND line, the active cell is always in the row immediately above the start of my table. The VBA code was originally generated using the macro recorder, so I know that when I used the EDIT/FIND function, the active cell became the cell containing the month I had entered.
In the VBA code I determine the date using the following statement...
rfld = "01/" & Mid("0" & Month(Now()) + 1, Len(Month(Now())), 2) & "/" & Year(Now())
...and use the variable in the cells.find code that follwos ...
Cells.Find(What:=rfld, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)