Ok first off, this is the very first time I've ever tried using VBA/Macros etc. So please, baby-steps and simple explanations needed
I have a sheet with dates running down collumn B (If it makes any difference, one date covers 2x cells that are merged - so 1st november covers B127 & B128, 2nd November covers B129 & B130). These 2 cells are the only cells merged for that date row
All dates are written as 01/11/2011, and formatted to show 01-Nov.
I simply need a macro (or if a button can be added to the sheet?) that when it's run, jumps to the cell or row(s) (as one date covers 2x rows) containing todays date
Already had a look at this thread and tried the following:
...and looked at the example sheet there, but when I go into Macro (Alt+F8) to run it, there is nothing there to run...Private Sub Worksheet_Activate() Dim Dt As Date Dt = Date Columns("B:B").Select Range("B1").Activate Selection.Find(What:=Dt, After:=ActiveCell, LookIn:=xlFormulas _ , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Select End Sub
I've also tried
Which does give me a macro called 'Sheet1.Finddate' but when I run it, nothing happens.Sub Finddate() Dim c As Range Set c = ActiveSheet.Cells.Find(what:=Date, LookIn:=xlValues) If Not c Is Nothing Then c.Select End Sub
Thanks
The reason you can't see "Worksheet_Activate" is because it's "Private". It also has a reserved Sub Name.
Excel automatically executes it when the sheet it's attached to is activated.
My 1st thought is that your dates in the sheet are formulas not values, just displayed as dates.
My 2nd thought is that the dates in the sheet have times included in them (just not displayed) and Date has a time of 00:00.
After that I would have to see the workbook.
Attached is an example file that I hope helps.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks