Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
on open goto cell with today's date
Private Sub Workbook_Open()
Dim res As Variant Dim Rng As Range Worksheets(2).Activate Set Rng = Worksheets(2).Range("B2:H2") res = Application.Match(CLng(Date), Rng, 0) If Not IsError(res) Then Rng(res).Select Else Set Rng = Worksheets(2).Range("B22:H22") res = Application.Match(CLng(Date), Rng, 0) If Not IsError(res) Then Rng(res).Select End If End If End Sub -- Regards, Tom Ogilvy DL wrote in message ... The range B2:H2,B22:H22 contains dates. Could this macro be amended to go to include the range B22:H22? Private Sub Workbook_Open() Dim res As Variant Dim Rng As Range Worksheets(2).Activate Set Rng = Worksheets(2).Range("B2:H2") res = Application.Match(CLng(Date), Rng, 0) If Not IsError(res) Then Rng(res).Select End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
on open goto cell with today's date
Many, many thanks for your assistance. It is much appreciated.
"Tom Ogilvy" wrote in message ... Private Sub Workbook_Open() Dim res As Variant Dim Rng As Range Worksheets(2).Activate Set Rng = Worksheets(2).Range("B2:H2") res = Application.Match(CLng(Date), Rng, 0) If Not IsError(res) Then Rng(res).Select Else Set Rng = Worksheets(2).Range("B22:H22") res = Application.Match(CLng(Date), Rng, 0) If Not IsError(res) Then Rng(res).Select End If End If End Sub -- Regards, Tom Ogilvy DL wrote in message ... The range B2:H2,B22:H22 contains dates. Could this macro be amended to go to include the range B22:H22? Private Sub Workbook_Open() Dim res As Variant Dim Rng As Range Worksheets(2).Activate Set Rng = Worksheets(2).Range("B2:H2") res = Application.Match(CLng(Date), Rng, 0) If Not IsError(res) Then Rng(res).Select End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
Goto Cell With Today's Or Other Date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
How to use Today's date in a cell and make it stay the same date | Excel Discussion (Misc queries) | |||
How to automatically goto to today's date | Excel Worksheet Functions |