Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can OnBlur() be used in Excel within a large workbook? 1

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
[tt]What I have is 10 worksheet workbook that wiht this code when the users saves the document at the last page when they open it again it defaults back to page one (this is working great)

Option Explicit
Private Sub Workbook_Open()
Worksheets("Sheet1").Select
End Sub


My question is, using the same same code, can I make the cursor automatically move to cell A7 for example upon opening??
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
You only have to add the following...

Application.Goto Reference:="R7C1"

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Nice!
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
[tt]
I'm trying to combine these two suggestions on one module but they are not working.

I'm trying to not only make the worksheet display at 90% but also goto a specific cell when opened.

Code 1
Option Explicit
Private Sub Workbook_Open()
Worksheets("Sheet1").Select
Application.Goto Reference:="R7C1"
End Sub


__________________________________
Code 2
Private Sub Workbook_Open()
ActiveWindow.Zoom = 90
End Sub



----- What I tried to do but crashed -----

I tried this but it did not work
Option Explicit
Private Sub Workbook_Open()
Worksheets("Sheet1").Select
Application.Goto Reference:="R7C1"
ActiveWindow.Zoom = 90
End Sub

----- What I tried to do but crashed -----
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
Hi Tony,

I tried your code, and it "worked" with no problem.

Did you place it in the "ThisWorkbook" ???

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Thanks Dale,

I'm getting a Run-time error '9';
Subscript out of range

and when I click on Debug
this line is in yellow

Private Sub Workbook_Open()
Worksheets("Name of sheet").Select
Application.Goto Reference:="N1"
ActiveWindow.Zoom = 90%
End Sub
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
ActiveWindow.Zoom = 90

NOT

ActiveWindow.Zoom = 90%
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
TonyU,

Are you certain "Name of sheet" in your code is exactly the same (including spacing) as the sheet tab?

Regards,
M. Smith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top