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
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

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
 

Watch MrExcel Video

Forum statistics

Threads
1,114,068
Messages
5,545,798
Members
410,708
Latest member
SanTrapGamer
Top