Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Can I toggle this Code - to Stamp and to UnStamp?

Below code is working just fine; I 've assigned it to a icon on my
Formatting Toolbar.
At present it is a one-directional Stamping of the Text "DRAFT....
I'de like to be able to click on my button "a second time" and have the text
"DRAFT..." disappear; then click again, and have it appear,
((Toggle-type)) - Can this be done?
If how, how would I modify (the code) it?
TIA,

Sub DraftStamp()
With ActiveSheet.Shapes.AddTextEffect( _
msoTextEffect1, "D R A F T" & Chr(10) & "ISSUED " & Date,
"Arial Black", _
24#, msoFalse, msoFalse, Left:=300, Top:=5)
With .Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 10
.Transparency = 0.2
End With
With .Line
.Weight = 0.75
.DashStyle = msoLineSolid
.Style = msoLineSingle
.Transparency = 0#
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.BackColor.RGB = RGB(255, 255, 255)
End With
.LockAspectRatio = msoTrue
.Height = 60#
.Width = 175#
.Rotation = 0#
End With
ActiveSheet.Protect _
DrawingObjects:=True, _
Contents:=False, _
Scenarios:=False
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I toggle this Code - to Stamp and to UnStamp?

Assuming you don't have other wordart on the sheet:

Sub DraftStamp()
For Each shp In ActiveSheet.Shapes
If InStr(1, shp.Name, "wordart", vbTextCompare) Then
ActiveSheet.Unprotect
shp.Delete
Exit Sub
End If
Next
With ActiveSheet.Shapes.AddTextEffect( _
msoTextEffect1, "D R A F T" & Chr(10) & "ISSUED " _
& Date, "Arial Black", _
24#, msoFalse, msoFalse, Left:=300, Top:=5)
With .Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 10
.Transparency = 0.2
End With
With .Line
.Weight = 0.75
.DashStyle = msoLineSolid
.Style = msoLineSingle
.Transparency = 0#
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.BackColor.RGB = RGB(255, 255, 255)
End With
.LockAspectRatio = msoTrue
.Height = 60#
.Width = 175#
.Rotation = 0#
End With
ActiveSheet.Protect _
DrawingObjects:=True, _
Contents:=False, _
Scenarios:=False
End Sub

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:hIvLb.70604$hf1.45492@lakeread06...
Below code is working just fine; I 've assigned it to a icon on my
Formatting Toolbar.
At present it is a one-directional Stamping of the Text "DRAFT....
I'de like to be able to click on my button "a second time" and have the

text
"DRAFT..." disappear; then click again, and have it appear,
((Toggle-type)) - Can this be done?
If how, how would I modify (the code) it?
TIA,

Sub DraftStamp()
With ActiveSheet.Shapes.AddTextEffect( _
msoTextEffect1, "D R A F T" & Chr(10) & "ISSUED " & Date,
"Arial Black", _
24#, msoFalse, msoFalse, Left:=300, Top:=5)
With .Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 10
.Transparency = 0.2
End With
With .Line
.Weight = 0.75
.DashStyle = msoLineSolid
.Style = msoLineSingle
.Transparency = 0#
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.BackColor.RGB = RGB(255, 255, 255)
End With
.LockAspectRatio = msoTrue
.Height = 60#
.Width = 175#
.Rotation = 0#
End With
ActiveSheet.Protect _
DrawingObjects:=True, _
Contents:=False, _
Scenarios:=False
End Sub




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
Command button to toggle worksheet event code on / off? Fred[_2_] Excel Discussion (Misc queries) 15 July 31st 07 11:50 AM
Toggle Button mick2 Excel Discussion (Misc queries) 5 November 27th 05 05:52 AM
Toggle button keithl816 Excel Discussion (Misc queries) 2 November 21st 05 09:16 PM
toggle between worksheets? Debbie Excel Discussion (Misc queries) 7 May 6th 05 01:28 AM
How to toggle Cesar Zapata[_2_] Excel Programming 3 November 15th 03 01:13 AM


All times are GMT +1. The time now is 04:28 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"