Opening to a specific cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can you please tell me how to go about opening a spreadsheet at a specific point within. I am keeping a timesheet and don't want to have to scroll through 11 months to get to December. How can I get the spreadsheet to open in December?

Thanks for the help!

matt
 
Save it in December before you close, or enter code in the Workbook_Open
event, such as:
Range("December").Select
where you have a range (one or more cells) named December.

--
Greeting from the Gulf Coast!
http://myweb.cableone.net/twodays
matt said:
Can you please tell me how to go about opening a spreadsheet at a specific
point within. I am keeping a timesheet and don't want to have to scroll
through 11 months to get to December. How can I get the spreadsheet to open
in December?
 
matt,

In a regular module.....

Sub Auto_Open()
Worksheets("Sheet1").Range("A1").Select
End Sub

The above will select cell A1 on Sheet1 whenever your
workbook opens. I know that's not exactly what you want
but if you provide some more info on how your sheet is
set up, I'm sure that I (or someone else here) can help
you get to the cell that you want.

John

matt said:
Can you please tell me how to go about opening a spreadsheet at a specific
point within. I am keeping a timesheet and don't want to have to scroll
through 11 months to get to December. How can I get the spreadsheet to open
in December?
 
matt,

On another note....

It sounds like you have your worksheet set up so that you
add new entries to the bottom of the list??
It's quite common for people to set up worksheets like
this (or so it seems from the many that I've seen).
Whenever I create a timesheet like worksheet (or anything
else with consecutive dates) I always reverse the sort order
and add new entries at the top.
Whenever I view the sheet, I'm presented with what's current
today and the past week or two.

Might I suggest that you try reversing the order and record
a macro to insert a new line at the top (you can even increment
the date automatically).

If you send me a direct e-mail, I'll mail you a workbook with
an example of this.

John
 
If Sheet1 isn't the activesheet, then this might work better:

Sub Auto_Open()
with Worksheets("Sheet1")
.select
.Range("A1").Select
end with
End Sub

or even:
Sub Auto_Open()
Application.Goto reference:=Worksheets("Sheet1").Range("A1"), scroll:=True
End Sub
 
OK, the basic layout of the spreadsheet has all of the weekdays listed by date in Column A. It would be ideal to embed a function that will check a calendar (windows calendar) and open to the cell that has the current date listed in it. But I think that might be too complicated (if it's not, let me know). I would be happy to have a formula that would engage when I open the spreadsheet to take me to the first date of the month. I suppose I could name all of the cells that make up that month and have it open to the name. What do you think

Is there a macro that could automatically run when the spreadsheet opens that would take me to the cell that holds the current day's date

Thanks for your help

Matt
 
Dave,

Forgot that little caveat of activating (or selecting) the sheet
before tryng to activate (or select) something on it.
Thanks for the correction.

John
 
matt,

I still like the idea of reverse sort and adding a new day at the top of
the list when you need to.
But I think that might be too complicated.
You must be new to this group. Please perish that thought.

The following will work if you have column "A" set up as a date.
Someone else will probably chime in with some cleaner and more concise code.

Sub TestMe()
Range(Range("A1"), Range("A65536").End(xlUp)).Select
Selection.Find(What:=Date, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Select
End Sub

Try the above.
If it works, call it from the Auto_Open macro

Sub Auto_Open()
TestMe
End Sub

John


matt said:
OK, the basic layout of the spreadsheet has all of the weekdays listed by
date in Column A. It would be ideal to embed a function that will check a
calendar (windows calendar) and open to the cell that has the current date
listed in it. But I think that might be too complicated (if it's not, let
me know). I would be happy to have a formula that would engage when I open
the spreadsheet to take me to the first date of the month. I suppose I
could name all of the cells that make up that month and have it open to the
name. What do you think.
Is there a macro that could automatically run when the spreadsheet opens
that would take me to the cell that holds the current day's date?
 
=?Utf-8?B?bWF0dA==?= wrote
Is there a macro that could automatically run when the spreadsheet
opens that would take me to the cell that holds the current day's
date?

With dates in Column A:

Private Sub Workbook_Open()
On Error Resume Next 'in case you open on a weekend
ActiveSheet.Columns(1).Find(Date).Select
End Sub
 
Back
Top