Inserting Image in a specific Cell within a Template

stephenscott

New Member
Joined
Mar 19, 2008
Messages
29
I have built a Excel Form which includes merged cells and am trying to build a macro to call for the signature and insert it is a specific cell within a password protected template.

The specific cell is Merged and it N58, however the macro below positions it up near cell 3?

Cel N58 is a constant for all signatures which I an trying to get it to resize to fir the cell area.

Also as a "bonus" I am looking for a simple way to unsert the individual users email address and wondered if I could call from their user properties within windows or excel?

Any suggestions would be greatly appreciated.

Stephenscott

-----------------------------------------------------------------------------------------

Sub InsertSignature()
Dim PicLocation As String
Dim MyRange As String

ActiveSheet.Unprotect
Range("N58").Select
MyRange = Selection.Address
PicLocation = Application.GetSaveAsFilename("Q:\Signatures\", "Image Files (*.jpg),*.jpg", , "Specify Image Location")

If PicLocation <> "False" Then
ActiveSheet.Pictures.Insert(PicLocation).Select
Else
Exit Sub
End If

With Selection.ShapeRange
.LockAspectRatio = msoTrue
If .Width > .Height Then
.Width = Range(MyRange).Width
If .Height > Range(MyRange).Height Then .Height = Range(MyRange).Height
Else
.Height = Range(MyRange).Height
If .Width > Range(MyRange).Width Then .Width = Range(MyRange).Width
End If
End With

With Selection
.Placement = xlMoveAndSize
.PrintObject = True
End With

ActiveSheet.Protect
End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,517
Messages
6,179,237
Members
452,898
Latest member
Capolavoro009

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