Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default 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
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 to show "DRAFT" on print versions of test documents. chopspop Excel Discussion (Misc queries) 4 November 23rd 08 08:28 AM
"Draft" background automatically in Excel... Rianto Excel Discussion (Misc queries) 2 June 7th 08 04:26 PM
How do I insert a watermark in Excel containing the word "draft" C-bah-hobbit Excel Discussion (Misc queries) 4 July 30th 07 06:38 PM
How do I get "Draft" to print across the front of a spreadsheet? Owens DOF Excel Discussion (Misc queries) 3 February 26th 07 08:33 PM
how can I get the word "draft" printed over my completed workshee. roger ramjet Excel Discussion (Misc queries) 2 May 26th 06 02:41 AM


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

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

About Us

"It's about Microsoft Excel"