![]() |
Jumping to a certain cell
Dear Excell(ent) users,
I have a file with multiple sheets. In those sheets I work with dates (dd-mm-yy). What I am looking for is a macro which opens the file in those sheets at the current date. For instance 15-03-2007 is in Cell BX3, so when it would be 15-03-2007 when I open that sheet, the cursor should be in BX3. Can you help me, please? Thank you ! |
Jumping to a certain cell
You would want to use an Event macro.
Event Macros, Worksheet Events and Workbook Events http://www.mvps.org/dmcritchie/excel/event.htm Worksheet_Activate Event (#ws_activate) http://www.mvps.org/dmcritchie/excel...tm#ws_activate which is set up for the current date upon sheet activation you can limit it to a specific column. --- HTH, David McRitchie, Microsoft MVP - Excel My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "The Fool on the Hill" wrote in message ... Dear Excell(ent) users, I have a file with multiple sheets. In those sheets I work with dates (dd-mm-yy). What I am looking for is a macro which opens the file in those sheets at the current date. For instance 15-03-2007 is in Cell BX3, so when it would be 15-03-2007 when I open that sheet, the cursor should be in BX3. Can you help me, please? Thank you ! |
Jumping to a certain cell
Put this in Worksheet code for the sheet in question:
Private Sub Worksheet_Activate() Dim s As String s = Date For Each r In ActiveSheet.UsedRange If Not IsEmpty(r) Then If s = r.Value Then r.Select Exit Sub End If End If Next End Sub -- Gary''s Student - gsnu200720 "The Fool on the Hill" wrote: Dear Excell(ent) users, I have a file with multiple sheets. In those sheets I work with dates (dd-mm-yy). What I am looking for is a macro which opens the file in those sheets at the current date. For instance 15-03-2007 is in Cell BX3, so when it would be 15-03-2007 when I open that sheet, the cursor should be in BX3. Can you help me, please? Thank you ! |
Jumping to a certain cell
To have the activate operate on all sheets place the code into Thisworkbook
module and rename to Private Sub Workbook_SheetActivate(ByVal Sh As Object) Gord Dibben MS Excel MVP On Fri, 11 May 2007 07:36:00 -0700, Gary''s Student wrote: Put this in Worksheet code for the sheet in question: Private Sub Worksheet_Activate() Dim s As String s = Date For Each r In ActiveSheet.UsedRange If Not IsEmpty(r) Then If s = r.Value Then r.Select Exit Sub End If End If Next End Sub -- Gary''s Student - gsnu200720 "The Fool on the Hill" wrote: Dear Excell(ent) users, I have a file with multiple sheets. In those sheets I work with dates (dd-mm-yy). What I am looking for is a macro which opens the file in those sheets at the current date. For instance 15-03-2007 is in Cell BX3, so when it would be 15-03-2007 when I open that sheet, the cursor should be in BX3. Can you help me, please? Thank you ! |
All times are GMT +1. The time now is 07:48 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com