ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vba to go to another sheet in same workbook (https://www.excelbanter.com/excel-programming/409573-vba-go-another-sheet-same-workbook.html)

Mali[_2_]

Vba to go to another sheet in same workbook
 
hi i need to use code to move to a different sheet in a woorkbook. i can do
this by using assign hyperlink to a shape object...but i want to also have
some code that does something in the new sheet when this object is clicked.

i've tried assign hyperlink and then assign a macro to the same object..in
that case the hyperlink works byt the macro doesnt seem to work. which is why
ifigured if i could put the hyperlionk in the code then both will work.

any help would be much appreciated.

Gary''s Student

Vba to go to another sheet in same workbook
 
Don't bother to put a hyperlink in the VBA. If you are already in the macro,
then just:

Sheets("Sheet5").Activate

will take you to a new sheet as easily as the hyperlink would.
--
Gary''s Student - gsnu200779


"Mali" wrote:

hi i need to use code to move to a different sheet in a woorkbook. i can do
this by using assign hyperlink to a shape object...but i want to also have
some code that does something in the new sheet when this object is clicked.

i've tried assign hyperlink and then assign a macro to the same object..in
that case the hyperlink works byt the macro doesnt seem to work. which is why
ifigured if i could put the hyperlionk in the code then both will work.

any help would be much appreciated.


Mali[_2_]

Vba to go to another sheet in same workbook
 
great thx worked perfectly!!!!

"Gary''s Student" wrote:

Don't bother to put a hyperlink in the VBA. If you are already in the macro,
then just:

Sheets("Sheet5").Activate

will take you to a new sheet as easily as the hyperlink would.
--
Gary''s Student - gsnu200779


"Mali" wrote:

hi i need to use code to move to a different sheet in a woorkbook. i can do
this by using assign hyperlink to a shape object...but i want to also have
some code that does something in the new sheet when this object is clicked.

i've tried assign hyperlink and then assign a macro to the same object..in
that case the hyperlink works byt the macro doesnt seem to work. which is why
ifigured if i could put the hyperlionk in the code then both will work.

any help would be much appreciated.



All times are GMT +1. The time now is 05:48 PM.

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