Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe try using sheet level names. Use the Define Names dialog box to
set each name to TRUE or FALSE. Caveat: That respective worksheet has to be the active sheet to add the name for that sheet. For example: Name Refers to: ---------------- ---------- Sheet1!PrintFlag TRUE Sheet2!PrintFlag FALSE Sheet3!PrintFlag TRUE and a quick routine to show how to display them: Public Sub ShowSheetLevelNames() Dim ws As Worksheet Dim strSheetLevelName As String Dim blnRefersTo As Boolean For Each ws In Worksheets strSheetLevelName = "'" & ws.Name & "'!PrintFlag" 'Strip the "=" off of the front of the string. blnRefersTo = Replace(Names(strSheetLevelName).RefersTo, Find:="=", Replace:="", Start:=1, Compa=vbTextCompare) If blnRefersTo _ Then MsgBox strSheetLevelName & " is " _ & Names(strSheetLevelName) & ".", _ vbInformation + vbOKOnly, "Sheet Level Name is TRUE" Else MsgBox strSheetLevelName & " is " _ & Names(strSheetLevelName) & ".", _ vbInformation + vbOKOnly, "Sheet Level Name is FALSE" End If Next ws End Sub Final question: If you have chart sheets that also need to be printed, how will you use this technique? (I think you would be forced to return to the original idea of a separate list of sheets, which I have used in my own work. You would have to include a property in your worksheet class that would simply call a property in a class designated to return the value of the flag for that sheet.) -- Regards, Bill Renaud |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW CAN I FLAG A CELL IN EXCEL WHEN IT HITS A REORDER LEVEL? | Excel Worksheet Functions | |||
difference of worksheet name and (name) property in VBA properties | Excel Programming | |||
Storing variable values in Excel worksheet | Excel Programming | |||
Print>Properties>Layout>Pages per sheet: this function/property . | Excel Discussion (Misc queries) | |||
Storing various data in .ID property | Excel Programming |