LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Help needed with a macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MAcro Needed Nimish Excel Discussion (Misc queries) 1 October 9th 06 04:05 AM
Help needed on Macro Gary Excel Worksheet Functions 8 September 6th 06 10:33 PM
Macro needed Randall Roberts Excel Worksheet Functions 1 June 16th 05 11:52 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"