Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attempted edit of protected cell jumps user to another cell megangomez Excel Discussion (Misc queries) 2 August 6th 09 12:54 AM
Why is Referenced Workbook Saved When ActiveWorkbook is Saved? RyanH Excel Programming 1 October 29th 08 08:20 PM
My tab key jumps to the next page, not the adjacent, cell, help... Kelly Excel Discussion (Misc queries) 2 June 1st 08 12:17 AM
Create Hyperlink to cell in another Workbook saved in Doc Manageme DeniseS Excel Discussion (Misc queries) 0 January 3rd 07 04:33 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"