Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook jumps to Sheet1, cell A1, regardless of where it was whenlast saved
I use the following macro to jump to a particular worksheet when a
workbook is opened and Sheet1!O70=0, however I'd like to modify it so that when those conditions are met, the cursor will rest on a particular cell such as A1. Are there any suggestions? Thanks in advance. Michael Private Sub Workbook_Open() With Me If .Worksheets("Sheet1").Range("O70").Value = 0 Then .Worksheets("Sheet1").Activate End If End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook jumps to Sheet1, cell A1, regardless of where it was when last saved
maybe this:
Private Sub Workbook_Open() With Me If .Worksheets("Sheet1").Range("O70").Value = 0 Then .Worksheets("Sheet1").Activate Application.Goto .Worksheets("Sheet1").Range("A1"), scroll:=True End If End With End Sub -- Gary Keramidas Excel 2003 "Michael Lanier" wrote in message ... I use the following macro to jump to a particular worksheet when a workbook is opened and Sheet1!O70=0, however I'd like to modify it so that when those conditions are met, the cursor will rest on a particular cell such as A1. Are there any suggestions? Thanks in advance. Michael Private Sub Workbook_Open() With Me If .Worksheets("Sheet1").Range("O70").Value = 0 Then .Worksheets("Sheet1").Activate End If End With End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook jumps to Sheet1, cell A1, regardless of where it was whenlast saved
Since you're using application.goto, you don't even need to activate sheet1.
Gary Keramidas wrote: maybe this: Private Sub Workbook_Open() With Me If .Worksheets("Sheet1").Range("O70").Value = 0 Then .Worksheets("Sheet1").Activate Application.Goto .Worksheets("Sheet1").Range("A1"), scroll:=True End If End With End Sub -- Gary Keramidas Excel 2003 "Michael Lanier" wrote in message ... I use the following macro to jump to a particular worksheet when a workbook is opened and Sheet1!O70=0, however I'd like to modify it so that when those conditions are met, the cursor will rest on a particular cell such as A1. Are there any suggestions? Thanks in advance. Michael Private Sub Workbook_Open() With Me If .Worksheets("Sheet1").Range("O70").Value = 0 Then .Worksheets("Sheet1").Activate End If End With End Sub -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook jumps to Sheet1, cell A1, regardless of where it waswhen last saved
Thanks Gary and Dave. It works as expected.
Michael |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Attempted edit of protected cell jumps user to another cell | Excel Discussion (Misc queries) | |||
Why is Referenced Workbook Saved When ActiveWorkbook is Saved? | Excel Programming | |||
My tab key jumps to the next page, not the adjacent, cell, help... | Excel Discussion (Misc queries) | |||
Create Hyperlink to cell in another Workbook saved in Doc Manageme | Excel Discussion (Misc queries) |