VBA - detect if text does not fit in the first merged cell

omnivl

Board Regular
Joined
Aug 25, 2014
Messages
53
I have text string that is produced from code that can vary from approx 250 words to 1000 words.
In my sheet i have two merged cell areas. I need to detect if the text string is to big to show in the first merged area, if it is then it needs to split and the last viewable word and move the remainder of the text string to the second merged area.

example.png



Any help would be much appreciated :)
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Omni love,

Wow! This is a tall order. With a cursory reading I could find these issues.

A) What will happen if you change the screen resolution and now your worksheet will look differently.

B) How can a code determine the location of the last visible cell?

C) Merged cell’s should be avoided like the plague. Look at this https://www.techrepublic.com/blog/10-things/10-ways-to-keep-excel-from-biting-you-in-the-butt/

You can search using the search term “avoid merged cells in excel” and you can see all sorts of horror stories, and alternatives to merged cells.

Best of luck in developing such Code. If you succeed I’d like to check it out.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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