Code to automatically adjust row height with merged cells?

CAMARD2

New Member
Joined
Dec 20, 2018
Messages
29
Hey all,

I'm not sure if this is at all possible, but I figuredif it is someone here would be able to help.


I'm trying to find a vba code that will automatically adjust the height of certain merged cells on a single row whenever the text becomes too long and gets cut off. I found a code that automatically adjusts all my merged cells in one go, but it is a one time thing and doesn't take effect whenever the cell is modified, so I scrapped it.

This is a worksheet that is constantly being worked on so sometimes there will be no text in the cells, in which case they can stay at 35 height (the default I set them as), but other times there may be lots of text and so I would need the cell to adjust automatically whenever the text passes the default 35 height. As of now I am adjusting the height manually each time, whenever needed, but if there is a way to have this done automatically that would be fantastic.

The range of cells that I want to be affected by this are B24 to E24, B30 to E30, B32 to E32, and B38 to E38.

Also it should be noted that I already have another vba code in place for this worksheet, to create a pdf file from the sheet and attach it in an outlook email. I have 2 modules for this, so I'm wondering where this new code will need to be placed?

Thanks in advance to anyone who is able to help me out here!
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Thanks for the link @Fluff !

I got it working, however it seems that my previous code to convert the excel sheet into a pdf file/attach to outlook no longer works.

From what I understand, you can not have a worksheet_change event and a commandbutton in the same sheet. Is that right ? If so is there a way around that or will I just have to choose which one is more important and scrap the other one?

Thanks

edit: NEVER MIND! I got both codes working. I just changed the ordering around for both codes.

Thank again!
 
Last edited:
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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