ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hyperlink coding? (https://www.excelbanter.com/excel-programming/284258-hyperlink-coding.html)

Phil Hageman[_3_]

Hyperlink coding?
 
The Sub below, assigned to a form control button,
correctly opens the "Customer" worksheet and sizes the
screen to 61%. I have some hyperlinks that also take
users to "Customer"; however, there is no screen sizing
involved. Is there a way to add code to a hyperlink
similar the below?

Sub GoToCustomer()
Application.ScreenUpdating = False
Sheets("Customer").Select
Range("A1").Select
ActiveWindow.Zoom = 61
Application.ScreenUpdating = True
End Sub

Tom Ogilvy

Hyperlink coding?
 
If you have excel 2000 or above, you can use the followhyperlink event.

You wouldn't put in the code to change the worksheet, as that would be done
by the hyperlink.
--
Regards,
Tom Ogilvy

"Phil Hageman" wrote in message
...
The Sub below, assigned to a form control button,
correctly opens the "Customer" worksheet and sizes the
screen to 61%. I have some hyperlinks that also take
users to "Customer"; however, there is no screen sizing
involved. Is there a way to add code to a hyperlink
similar the below?

Sub GoToCustomer()
Application.ScreenUpdating = False
Sheets("Customer").Select
Range("A1").Select
ActiveWindow.Zoom = 61
Application.ScreenUpdating = True
End Sub




Tom Ogilvy

Hyperlink coding?
 
Also, you might want to look at the worksheet_activate event. Perhaps do
the zooming there. I don't recall if this fires when a hyperlink activates
the page, but would be easy to test.

--
Regards,
Tom Ogilvy

"Phil Hageman" wrote in message
...
The Sub below, assigned to a form control button,
correctly opens the "Customer" worksheet and sizes the
screen to 61%. I have some hyperlinks that also take
users to "Customer"; however, there is no screen sizing
involved. Is there a way to add code to a hyperlink
similar the below?

Sub GoToCustomer()
Application.ScreenUpdating = False
Sheets("Customer").Select
Range("A1").Select
ActiveWindow.Zoom = 61
Application.ScreenUpdating = True
End Sub





All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com