Worksheet Properties? How to Tag sheets with data?

winxpdows

New Member
Joined
Apr 21, 2011
Messages
24
Any way to access Worksheets with custom properties like the Document Properties?

I am building an addin and I need to figure out when a user is on a worksheet that the addin created. For now, I just "hide" a word in the BA1 cell and have the addin check that cell when a procedure is called to see if the user is on a "valid" worksheet for use by the add-in.

The problem is that if the user deletes a column then the BA1 cell is no longer populated and the addin doesn't work on that worksheet anymore. I can't use the Sheet name itself because the user needs to be able to change the names if desired.

I am looking for another way to "tag" particular worksheets so that I can tell if the addin should run on them.

I figure if there are custom properties like Document properties, I can set those up and use them, but I can't find any info.

The other idea was in the VBA Editor, the properties window of a worksheet has both a (Name) field and a "Name" field that is shown on the bottom tabs of a workbook. Anyone know how to access the (Name) field? I can use that if I have to.


Thanks in advance for any help!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Found a solution...

Code:
ActiveWorksheet.CustomProperties.Add Name:= "TEST", Value := "101"
Msgbox ActiveWorksheet.CustomProperties.Item(1).Name
Msgbox ActiveWorksheet.CustomProperties.Item(2).Value
 
Upvote 0

Forum statistics

Threads
1,224,570
Messages
6,179,610
Members
452,931
Latest member
The Monk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top