Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem for expanding height of merged cells to show all data

Status
Not open for further replies.

Doraemon

IS-IT--Management
Sep 12, 2003
31
HK
I have a program which exports data from Access to Excel through VBA. But I find the following problem for the Excel file.

I have a merged cell called "Remarks", in which its value is very long that it have many rows in the cell. But whenever I open the Excel file, I find only one row is displayed for that cell with other rows being hidden. I have checked the "Wrap text" property in the Text Control area, but the cell still CANNOT be expanded to the fitted height for all values to be shown.

I find that for a normal cell, the height of the cell will be expaned automatically to show all values. But it seems that for a merged cell, it won't do that. I wonder whether there is any way to tackle it?

Thank a lot in advance!
 
Yes, I've run into the same problem. I've programmed around it, in a way that's probably too much trouble for you to bother with, but just in case, here's what I did:

My merged cell was A10 (and B10)
In hidden column J, in cell J10, set formula =A10
Column J columnwidth set equal to the width of the merged cell. Rows(10).autofit will now properly adjust the row height. Since my cell was a user input cell, I actually had to set a worksheet_change event to repeat the autofit every time the cell was changed. So it was messy, but it worked. Maybe you can adapt this to your situation.


Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top