Greetings, I have been the using the following code (thanks VoG!) to insert users names into text boxes on worksheets and it works great. So much so that I need to roll it out into some other documents. The rub was that when the original WB was set up it was only being used on my own or my bosses computer so I just put the signatures (the jpg's) in a folder on my computer. Now that the WB is getting passed around....
I put each of the jpg's in a blank WS in my book and tried to tweak the code to just pick it off of the WS instead of the desktop and had no luck (too embarassed to show you my attempts); can anyone give me a hand with this or is this something that cannot really be done properly. Basically I want to just put the signature jpg's on a worksheet in the in the same WB; I will probably even hide the sheet once I protect the WB and send it out. Thanks for any input - Rick
I put each of the jpg's in a blank WS in my book and tried to tweak the code to just pick it off of the WS instead of the desktop and had no luck (too embarassed to show you my attempts); can anyone give me a hand with this or is this something that cannot really be done properly. Basically I want to just put the signature jpg's on a worksheet in the in the same WB; I will probably even hide the sheet once I protect the WB and send it out. Thanks for any input - Rick
Code:
Sub RickSignature()
'
' This macro uses a JPEG of a signature as the fill of an textbox.
'
'
Dim s As String
On Error Resume Next
s = Selection.Name
On Error GoTo 0
If s = "" Or Not s Like "Rectangle*" Then
MsgBox "Click on a rectangle first"
Exit Sub
End If
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 2#
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.UserPicture _
"C:\Documents and Settings\rblunt1\Desktop\Rick.jpg"
End Sub