Measuring distances with vba

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Can you use vba to measure distances in excel, such as between any given row at the bottom of the current page?
 
Ok, maybe try it this way.
Put a page break at the end of Col "H" in the table thereby forcing the TextBox4 AND the signaure onto a new page !!
This will force the page break, you can adapt the picture size to suit

Code:
Sub MM1()
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)
If Cells(Rows.Count, "H").End(xlUp).Row > 1 Then
    Rows(Cells(Rows.Count, "H").End(xlUp).Row + 2).PageBreak = xlPageBreakManual
End If
End Sub
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
An extension of Alphafrogs post in THE OTHER THREAD at https://www.mrexcel.com/forum/excel-questions/1111050-uses-range-find-method.html

could be

Code:
Sub cmdCustomSig3()
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)
lr = Sheets("quote_sheet").TextBoxes("TextBox4").BottomRightCell.Row
Rows(lr + 2).PageBreak = xlPageBreakManual
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,384
Members
449,080
Latest member
Armadillos

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