vba macro to insert wordart "watermark"

ajf3

New Member
Joined
Apr 18, 2002
Messages
3
Hi all,

What I want to do is find a macro that will prompt for a word and insert a word art representation of that word as a "watermark" - centered on the current page (as in printed page # x that contains the cell with focus).

I've done a little reasearch on this and have found some vba scripts which do it for predefined #'s of pages in a worksheet - ie, hardcode it to do all 14 pages when you know there are 14 horizontal pages, etc.

Is there a way to simply do it to the printed page which will contain the cell currently in focus?

Thanks!
 
Re: vba macro to insert wordart "watermark"

Hi slirfeldt,

Here is a way to easily remove the watermark. I added a line to the original macro that adds the watermark to give it a name. Then the delete macro can easily find it to delete it. Here is the updated code for both macros:

Code:
Sub AddWatermark()

' Inserts a wordart "watermark" onto the current sheet with its
' upper left corner positioned on the upper left corner of the
' selected cell.

   Dim StrIn As String
   StrIn = InputBox("Enter watermark text")
   If StrIn = "" Then Exit Sub
   
   With ActiveSheet.Shapes.AddTextEffect(msoTextEffect9, StrIn, _
      "Arial Black", 36#, msoFalse, msoFalse, _
      10, 10)
      .ScaleWidth 2, msoFalse, msoScaleFromTopLeft
      .ScaleHeight 2, msoFalse, msoScaleFromBottomRight
      .Fill.Visible = msoTrue
      .Fill.Solid
      .Fill.ForeColor.SchemeColor = 26
      .Fill.Transparency = 0.5
      .Shadow.Transparency = 0.5
      .Line.Visible = msoFalse
      'position at cell corner
      .Top = Selection.Top
      .Left = Selection.Left
      .Name = "MyWatermark"
   End With

End Sub

Sub DelWatermark()
   ActiveSheet.Shapes("MyWatermark").Delete
End Sub

Damon
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Re: vba macro to insert wordart "watermark"

Hello! is there any macro coding which converts three cells text into three separate wordarts in a separate ms word file?
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top