Uses for the range.find method

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,120
Can you use the range.find method to find the lowest row that the contents of a text box have expanded down to cover?

For instance, if I have a regular text box with resize shape to fit text selected. I put the textbox in row 2, type "a" + hit enter, type "a" + hit enter, type "a" + hit enter, so now the text box covers from rows 2-4. Can I use the range.find method to find the lowest row the text has expanded to, so in this case, it will be row 4?

Or do you need an active x text box to do the same thing?
 

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,181
Try this...

Code:
LowestRow = Sheets("Sheet1").TextBoxes("Text Box 1").BottomRightCell.Row
 

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,120
Thanks for that AlphaFrog.

That gives me the row of the bottom of my text box. Is there a way to measure the distance between several rows below that point and the bottom of the page that is on that sheet?
 

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,181
I thought you wanted the bottom of textbox row.

I don't understand what the rest of that means.
 

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,120
Sorry to be a bit vague before AlphaFrog. I did want the bottom of the text row but that was to try and work out if I could use it to see if a image would fit in the space between the bottom of the box and the end of the page. If there wasn't enough space, I wanted the image pushed to the next page or maybe a page break being inserted. So wanting to know how to find the lowest row was just a means to an end, but I am still having trouble with the end.

Do you know how I could solve the above problem?
 

Forum statistics

Threads
1,084,735
Messages
5,379,503
Members
401,608
Latest member
nanana2020

Some videos you may like

This Week's Hot Topics

  • VBA code giving errors and stopping Excel
    Hello Experts, I have this code being used to loop through files in a file path, and copy specific data to another sheet. It is giving me several...
  • Disable MsgBox message
    Morning, I have a userform where if i leave a ComboBox empty i see a MsgBox warning me that i must enter an invoice number. It is this MsgBox i...
  • Macro Recorder into VBA, Copy Paste Data Filled Cells
    Hi Everyone, I have a macro recorder file that takes a selection of data, copies, then pastes into a new sheet on ("A2:B2") The issue is my...
  • Number format changes while pasting into a cell
    Hi, I am trying to paste a number 180204524303 from an email to an excel cell, however, whenever i try to do so , the the paste value appears as...
  • Collating data
    Hello all. Could someone please help. I am trying to pull all column data from multiple sheets (24 I total so far) into 1 master sheet without...
  • Sum Multiple Columns Based on Multiple Criteria
    I am trying to consolidate data by summing columns G through M based on material, plant, vendor, and fiscal year being identical. The period does...
Top