ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling a Sheet (https://www.excelbanter.com/excel-programming/341234-calling-sheet.html)

[email protected]

Calling a Sheet
 
I write a lot of VBA excel reports for the company I work for and people like
to rename sheets and then complain when the macro doesn't work anymore. So I
found out you can call the sheets by their number. Well here is my problem,
I think the sheets have to be in the order that you put them in. What if
someone moves the sheets arounds and ereases all the data. Is there a
specific way to call sheets by the sheet number that are show in the VBA?
For examples one of my sheets is called "Select a Group" and in VBA is is
shown as Sheet5(Select a Group) Is there a way I can call the Sheet5 part
because I know that will not change?

Thanks

Tom Ogilvy

Calling a Sheet
 
Sheet5.Range("A2").value = 6


--
Regards,
Tom Ogilvy


" wrote in
message ...
I write a lot of VBA excel reports for the company I work for and people

like
to rename sheets and then complain when the macro doesn't work anymore.

So I
found out you can call the sheets by their number. Well here is my

problem,
I think the sheets have to be in the order that you put them in. What if
someone moves the sheets arounds and ereases all the data. Is there a
specific way to call sheets by the sheet number that are show in the VBA?
For examples one of my sheets is called "Select a Group" and in VBA is is
shown as Sheet5(Select a Group) Is there a way I can call the Sheet5 part
because I know that will not change?

Thanks





All times are GMT +1. The time now is 09:18 PM.

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