ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refer to worksheet (https://www.excelbanter.com/excel-programming/371433-refer-worksheet.html)

Arne Hegefors

Refer to worksheet
 
I want to refer to a worksheet that has a certain name. Now I write:

Set rapportWorksheet = "Rapport"

That is I want to somehow be able to use this variable later and refer to
the worksheet by the variable. That way I only have to change the name of the
worksheet once in case I have to do that. Please help me with the syntax.
Thanks very much!

NickHK[_3_]

Refer to worksheet
 
Arne,
Set rapportWorksheet =
ThisWorkbook/Activeworkbook/Workbooks("Whatever").Worksheets("Rapport")

NickHK

"Arne Hegefors" ...
I want to refer to a worksheet that has a certain name. Now I write:

Set rapportWorksheet = "Rapport"

That is I want to somehow be able to use this variable later and refer to
the worksheet by the variable. That way I only have to change the name of
the
worksheet once in case I have to do that. Please help me with the syntax.
Thanks very much!




Die_Another_Day

Refer to worksheet
 
Set rapportWorksheet = Sheets("Rapport")

HTH

Charles

Arne Hegefors wrote:
I want to refer to a worksheet that has a certain name. Now I write:

Set rapportWorksheet = "Rapport"

That is I want to somehow be able to use this variable later and refer to
the worksheet by the variable. That way I only have to change the name of the
worksheet once in case I have to do that. Please help me with the syntax.
Thanks very much!




All times are GMT +1. The time now is 10:30 PM.

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