ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Command Button Hyperlink (https://www.excelbanter.com/excel-discussion-misc-queries/140540-command-button-hyperlink.html)

jgarner

Command Button Hyperlink
 
I have a command button (CommandButton1) on 'Sheet1' of an Excel spreadsheet.
I would like to be able to click on the command button and have it take me to
'Sheet2!A1'. What is the code that is entered into the module?

FSt1

Command Button Hyperlink
 
hi,
Sub macGoTo()
Sheets("sheet2").Activate
Range("A1").Select
End Sub

But why not just click the tab?????

Regards
FSt1

"jgarner" wrote:

I have a command button (CommandButton1) on 'Sheet1' of an Excel spreadsheet.
I would like to be able to click on the command button and have it take me to
'Sheet2!A1'. What is the code that is entered into the module?


jgarner

Command Button Hyperlink
 
Thanks for your help. And yes, I could just click on the sheet tab, and I
could also use text in a cell as the hyperlink (which makes it very easy),
but it is an Excel feature that I wanted to learn how to do, and I also have
to create a spreadsheet for users that has hidden sheet tabs and is a
protected document to prevent users from changing the layout.

"FSt1" wrote:

hi,
Sub macGoTo()
Sheets("sheet2").Activate
Range("A1").Select
End Sub

But why not just click the tab?????

Regards
FSt1

"jgarner" wrote:

I have a command button (CommandButton1) on 'Sheet1' of an Excel spreadsheet.
I would like to be able to click on the command button and have it take me to
'Sheet2!A1'. What is the code that is entered into the module?



All times are GMT +1. The time now is 08:21 PM.

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