Auto sizing on row height

Solar

Board Regular
Joined
Mar 11, 2003
Messages
90
I am pulling data in from an external DB to excel. I have a formula in a cell that is actually a merge of six adjacent cells. The formula concatenates the word "PM3" with the contents of another cell. I have the cell formatted to wrap text.

My issue is that when the sheet is run, if the text is longer than one row of data within the cell, it does wrap the text but the row height does not automatically change so that the entire data set can be seen. I am having to manually increase the row height.

What do I need to do to have the row height adjust automatically depending upon the length of the data in the row?

thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Hi,

This code cycles through the current worksheet and autofits the row height.

Code:
Sub test()

Dim myRow As Range

For Each myRow In ActiveSheet.UsedRange

myRow.Rows.AutoFit

Next myRow

End Sub

Might be of some use to you.
 

ray in maur

New Member
Joined
Oct 2, 2006
Messages
6
I have this same problem but I just right click and save as text and that works fine for me
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,026
Messages
5,856,930
Members
431,839
Latest member
Guest user

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
Top