LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Storing flag values at worksheet level (Property or Properties

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW CAN I FLAG A CELL IN EXCEL WHEN IT HITS A REORDER LEVEL? PENNY Excel Worksheet Functions 2 July 11th 08 01:56 PM
difference of worksheet name and (name) property in VBA properties [email protected] Excel Programming 2 July 28th 06 12:32 AM
Storing variable values in Excel worksheet Henry Stockbridge Excel Programming 3 April 25th 06 02:38 PM
Print>Properties>Layout>Pages per sheet: this function/property . Turck Excel Discussion (Misc queries) 2 May 28th 05 10:45 PM
Storing various data in .ID property Thorsten Walenzyk Excel Programming 10 December 9th 04 08:27 PM


All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"