Image being placed below line or text box

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a spreadsheet that will have x number of lines added to it. When all lines have been added, I have a button that inserts a signature 5 lines below the lowest part. The lowest part is a line at the bottom. Underneath the line, there is a textbox that will have notes written in it sometimes. Therefore, if there is 3 lines in the notes box, I will need to insert the text box 8 lines below the line. This is my code from the button that inserts the signature.

Code:
Sub cmdGarrettSig()
        'ActiveSheet.Unprotect Password:="npssadmin"
    Dim sht As Worksheet
        Set sht = ActiveSheet
    Dim lr As Long
    'Find the last used row in Column A of target.  Change column as required
        lr = Sheets("NPSS_quote_sheet").Range("A" & Rows.Count).End(xlUp).Row + 4
            Sheets("sheet2").Shapes("ImgG").Copy
            Sheets("NPSS_quote_sheet").Paste _
                Destination:=Worksheets("NPSS_quote_sheet").Range("A" & lr + 6)
    'ActiveSheet.Protect Password:="npssadmin"
End Sub

Can someone help me update it so that the lowest part of the spreadsheet is the bottom part of the text box please?

Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try this method
- image is placed relative to your textbox


Code:
Sub CopyImage()

    Dim shp As Shape
    Set shp = Sheets("NPSS_quote_sheet").Shapes("[I][COLOR=#ff0000]name of textbox[/COLOR][/I]")

    Sheets("Sheet2").Shapes("ImgG").Copy
    Sheets("NPSS_quote_sheet").Paste Destination:=Sheets("NPSS_quote_sheet").Cells(1, 1)
    Selection.Top = shp.Top + shp.Height
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,954
Members
448,535
Latest member
alrossman

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