Uses for the range.find method

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,129
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,194
Try this...

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

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,129
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,194
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,129
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,085,565
Messages
5,384,469
Members
401,903
Latest member
MarBer

Some videos you may like

This Week's Hot Topics

Top