Open at specific cell

Joined
Nov 19, 2006
Messages
3
Reaction score
0
Hello New User here
I have a spread sheet with dates of the current year across row 1. is there any way I can get workbook to open at the current date cell in that row every time i open workbook?

Thankyou Mcgregor
 
so when the workbook is openned have the cell with the current date selected??
 
Open workbook go to specific cell

place this code in the workbook module, every time the sheet is activated, it selects todays date in column F......

change the column as you require


Code:
[font=Arial]'If you have date's in column F then this example will select [/font][font=Arial]the cell with today's date.[/font]   [font=Arial][b]Private Sub Workbook_Open()
     Dim FindString As Date
     Dim rng As Range
     FindString = Date
     With Sheets("Sheet1").Range("F:F")
         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
     End With
 
 End Sub
 
 
 [/b][/font]

this code and many other useful code can be found at this site

http://www.rondebruin.nl/find.htm
 

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

Back
Top