Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Placing "DRAFT" just on Certain Sheets
The below code is perfect for toggling "DRAFT" on/off an
activesheet, but I need to modify it as follows. I'm lost as to which way to turn/go. Any assistance would be greatly appreciated. My workbook has several tabs (worksheets). I need to permanently place "DRAFT" on ALL worksheets (disallow toggling) that DO NOT have the word "NOTES" as part of the sheet name, example "IP-CUR NOTES" - Code would allow for additional tabs (sheets) being added. Thanks in Advance, JMay |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Placing "DRAFT" just on Certain Sheets
I'm not sure what you mean by placing "DRAFT" on each
sheet, in a particular cell? (the code you mentioned does not appear in this post). Whatever, perhaps you could try something like this: Sub Test() Dim ws As Worksheet Dim sNote As String sNote = "NOTES" For Each ws In ActiveWorkbook.Worksheets If InStr(1, ws.Name, sNote, 1) = 0 Then 'do code to place "DRAFTS" End If Next End Sub See InStr in help, change the last argument to zero for case sensitive comparison Code would allow for additional tabs (sheets) being added An Event is triggered when a new sheet is added, however it will be named "SheetX". Possibly within the event you could ask the user give a new sheet name via an Inputbox, then check the input string or run the above code. Regards, Sandy -----Original Message----- The below code is perfect for toggling "DRAFT" on/off an activesheet, but I need to modify it as follows. I'm lost as to which way to turn/go. Any assistance would be greatly appreciated. My workbook has several tabs (worksheets). I need to permanently place "DRAFT" on ALL worksheets (disallow toggling) that DO NOT have the word "NOTES" as part of the sheet name, example "IP-CUR NOTES" - Code would allow for additional tabs (sheets) being added. Thanks in Advance, JMay . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Placing "DRAFT" just on Certain Sheets
Thanks Sandy;
Yes, in my confused state I forgot to copy in the "below code"; thanks for offering a viable alternative. JMay "Sandy-V" wrote in message ... I'm not sure what you mean by placing "DRAFT" on each sheet, in a particular cell? (the code you mentioned does not appear in this post). Whatever, perhaps you could try something like this: Sub Test() Dim ws As Worksheet Dim sNote As String sNote = "NOTES" For Each ws In ActiveWorkbook.Worksheets If InStr(1, ws.Name, sNote, 1) = 0 Then 'do code to place "DRAFTS" End If Next End Sub See InStr in help, change the last argument to zero for case sensitive comparison Code would allow for additional tabs (sheets) being added An Event is triggered when a new sheet is added, however it will be named "SheetX". Possibly within the event you could ask the user give a new sheet name via an Inputbox, then check the input string or run the above code. Regards, Sandy -----Original Message----- The below code is perfect for toggling "DRAFT" on/off an activesheet, but I need to modify it as follows. I'm lost as to which way to turn/go. Any assistance would be greatly appreciated. My workbook has several tabs (worksheets). I need to permanently place "DRAFT" on ALL worksheets (disallow toggling) that DO NOT have the word "NOTES" as part of the sheet name, example "IP-CUR NOTES" - Code would allow for additional tabs (sheets) being added. Thanks in Advance, JMay . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to show "DRAFT" on print versions of test documents. | Excel Discussion (Misc queries) | |||
"Draft" background automatically in Excel... | Excel Discussion (Misc queries) | |||
How do I insert a watermark in Excel containing the word "draft" | Excel Discussion (Misc queries) | |||
How do I get "Draft" to print across the front of a spreadsheet? | Excel Discussion (Misc queries) | |||
how can I get the word "draft" printed over my completed workshee. | Excel Discussion (Misc queries) |