ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom properties for worksheets (https://www.excelbanter.com/excel-programming/372569-custom-properties-worksheets.html)

Thelonious Monk

Custom properties for worksheets
 
Is it possible to create custom properties at the worksheet level? I want
to set a property that will identify a worksheet as a particular type.

Thanks!



Harald Staff

Custom properties for worksheets
 
Hi

Enter something like this on top of the (or all) sheet's module:

Public GreatSheet As Boolean

and you can set it to False or True from anywhere and read it from anywhere,
like:

Sheets(2).GreatSheet = True

Msgbox Sheets(1).GreatSheet

HTH. Best wishes Harald

"Thelonious Monk" skrev i melding
...
Is it possible to create custom properties at the worksheet level? I want
to set a property that will identify a worksheet as a particular type.

Thanks!





Tom Ogilvy

Custom properties for worksheets
 
If the purpose is to query it with code, you might want to use a sheet level
defined name.

--
Regards,
Tom Ogilvy

"Thelonious Monk" wrote in message
...
Is it possible to create custom properties at the worksheet level? I want
to set a property that will identify a worksheet as a particular type.

Thanks!




NickHK

Custom properties for worksheets
 
A WS a basically a class model, so you can add either Public variables or
Property Get/Let. Also Enum and other class type constructs.
'On ThisWorkbook module
Public Enum WS_Type
WS_Basic
WS_Totals
WS_Calculation
End Enum

'On a WS module
Private mTester As WS_Type

Public Property Let Tester(vData As WS_Type)
mTester = vData
End Property

Public Property Get Tester() As WS_Type
Tester = mTester
End Property

NickHK

"Thelonious Monk" wrote in message
...
Is it possible to create custom properties at the worksheet level? I want
to set a property that will identify a worksheet as a particular type.

Thanks!






All times are GMT +1. The time now is 03:00 AM.

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