find day

S

Sj

I have a workbook that in the first sheet is daily data that changes and the
rest of the sheets relate to a day in the month, I want to be able to type in
todays date in the first worksheet (A1) and then run a macro to go to that
day, is this possible?

any help appreciated.
 
L

Luke M

Sure. Record yourself doing a Find operation, and in the macro, replace the
text string with a cell reference, like so:

Sub FindMe()
'Change the What:=Range(XX).value to match your cell
Cells.Find(What:=Range("A1").Value, After:=Range("A1"), _
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
End Sub
 
J

Jacob Skaria

If sheet is named as 13082009 without any spaces and in cell a1 you have the
date 08/13/2009 in excel date format..try the below code....

Sub Macro()
Dim strSheet As String
strSheet = Format(Range("A1"), "ddmmyyyy")
Sheets(strSheet).Activate
End Sub

If this post helps click Yes
 
S

Sj

Thanks, I tried this and I am still having problems, what i want to do is to
have 32 sheets in the workbook, in sheet 1, cell A1 I want to have the today
formula and then in sheet 2 the A1 cell will be a blank cell into which I
input the date on the first day of the month, the following sheets will all
have corresponding formulas to work out the rest of the days in the month. I
want to be able to open up the book on sheet one and have a button which lets
me go to the corresponding day as cell A1 shows, and I this is where I am
struggling, any ideas.
 
S

Sj

Thanks, I tried this and I am still having problems, what i want to do is to
have 32 sheets in the workbook, in sheet 1, cell A1 I want to have the today
formula and then in sheet 2 the A1 cell will be a blank cell into which I
input the date on the first day of the month, the following sheets will all
have corresponding formulas to work out the rest of the days in the month. I
want to be able to open up the book on sheet one and have a button which lets
me go to the corresponding day as cell A1 shows, and I this is where I am
struggling, any ideas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top