dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
On my spreadsheet, there are 2 buttons and below them I have a textbox that has notes entered in it. One button inserts a signature that is stored on another sheet and the other button allows for the entry of a custom signature. The image on the signature is inserted just below the bottom of the text box. The sub to insert the signature works fine except that if notes have been added to the textbox so there is only enough room to enter part of the signature on the current page and the rest on the page below it, the signature will be split.
The textbox is called textbox4.
The code to enter the signature stored in another sheet is
The code to enter the custom signature is
Could someone help me change the code so the image of the signatures does not get split if it lies across a page break, half on one page and half on the next but is pushed down to the following page below if that happens please?
The textbox is called textbox4.
The code to enter the signature stored in another sheet is
VBA Code:
Sub cmdGarrettSig()
Dim shp As Shape
Set shp = ActiveSheet.Shapes("textbox4")
Sheets("Sheet2").Shapes("ImgG").Copy
ActiveSheet.Paste Destination:=ActiveSheet.Cells(1, 1)
Selection.Top = shp.Top + shp.Height + "50"
End Sub
The code to enter the custom signature is
VBA Code:
Sub cmdCustomSig()
Dim fNameAndPath As Variant
Dim img As Picture, shp As Shape
Set shp = ThisWorkbook.Worksheets("quote_sheet").Shapes("textbox4")
fNameAndPath = Application.GetOpenFilename(Title:="Select Picture To Be Imported")
If fNameAndPath = False Then Exit Sub
Set img = Worksheets("quote_sheet").Pictures.Insert(fNameAndPath)
With img
.Top = shp.Top + shp.Height + "50"
.Left = "0"
End With
End Sub
Could someone help me change the code so the image of the signatures does not get split if it lies across a page break, half on one page and half on the next but is pushed down to the following page below if that happens please?