Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I use a macro which includes the following code to locate the cell in row 1
which contains today's date. Dim FindString As Date Dim rng As Range FindString = Date With Sheets("Sheet1").Range("1:1") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If I now want to do the same on another spreadsheet where row 1 consists instead of cells containing dates of just the 1st of each month (i.e. monthly columns). The macro works well on the first each of month but, of course, cannot find anything on the other days! Can anyone please suggest how I can amend the code so it locates the cell containing the same month and year as today. I have tried a number of options, but none seem to work. Thanks, V |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MAcro Needed | Excel Discussion (Misc queries) | |||
Help needed on Macro | Excel Worksheet Functions | |||
Macro needed | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |