Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Autofit row height


I have a spreadsheet (call MainForm) contain data from col A - H with "wrap
text" option on. Column A, B receive data from user input while column C, D &
E receive data via a hyperlink to 2 separate spreadsheet as shown in sample
below:
='C:\$User\[Issue 01.xls]EntryForm'!$H$5
='C:\$User\[Issue 01.xls]EntryForm'!$L$5
='C:\$User\[Issue 01.xls]EntryForm'!$M$5
Cell (H5, L5 & M5) are cell contain text data.

I use the following loop to adjust the row height in each cell of the MainForm

For i=Start_Row to End_Row
Rows(CStr(i) & ":" & CStr(i)).EntireRow.AutoFit
Next i

I found that NOT all row height are correctly adjusted. For example, if one
of the cells in a row contains 5 rows of data within that cell it display
only 3 wrapped lines of data within the cell in stead of 5 as I expected.
This problem is very consistent in the linked cells.

Can someone please tell me how can I correct this problem s.t. when the loop
is complete, all rows' height are correctly adjusted with its max lines of
wrapped text displayed ?

Thanks in advance for any assistance.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofit row height

Do you have merged cells?

Autofit doesn't work with merged cells.

--
Regards,
Tom Ogilvy
"Wellie" wrote in message
...

I have a spreadsheet (call MainForm) contain data from col A - H with

"wrap
text" option on. Column A, B receive data from user input while column C,

D &
E receive data via a hyperlink to 2 separate spreadsheet as shown in

sample
below:
='C:\$User\[Issue 01.xls]EntryForm'!$H$5
='C:\$User\[Issue 01.xls]EntryForm'!$L$5
='C:\$User\[Issue 01.xls]EntryForm'!$M$5
Cell (H5, L5 & M5) are cell contain text data.

I use the following loop to adjust the row height in each cell of the

MainForm

For i=Start_Row to End_Row
Rows(CStr(i) & ":" & CStr(i)).EntireRow.AutoFit
Next i

I found that NOT all row height are correctly adjusted. For example, if

one
of the cells in a row contains 5 rows of data within that cell it display
only 3 wrapped lines of data within the cell in stead of 5 as I expected.
This problem is very consistent in the linked cells.

Can someone please tell me how can I correct this problem s.t. when the

loop
is complete, all rows' height are correctly adjusted with its max lines of
wrapped text displayed ?

Thanks in advance for any assistance.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Autofit row height

No. None of the cells are merged.

"Tom Ogilvy" wrote:

Do you have merged cells?

Autofit doesn't work with merged cells.

--
Regards,
Tom Ogilvy
"Wellie" wrote in message
...

I have a spreadsheet (call MainForm) contain data from col A - H with

"wrap
text" option on. Column A, B receive data from user input while column C,

D &
E receive data via a hyperlink to 2 separate spreadsheet as shown in

sample
below:
='C:\$User\[Issue 01.xls]EntryForm'!$H$5
='C:\$User\[Issue 01.xls]EntryForm'!$L$5
='C:\$User\[Issue 01.xls]EntryForm'!$M$5
Cell (H5, L5 & M5) are cell contain text data.

I use the following loop to adjust the row height in each cell of the

MainForm

For i=Start_Row to End_Row
Rows(CStr(i) & ":" & CStr(i)).EntireRow.AutoFit
Next i

I found that NOT all row height are correctly adjusted. For example, if

one
of the cells in a row contains 5 rows of data within that cell it display
only 3 wrapped lines of data within the cell in stead of 5 as I expected.
This problem is very consistent in the linked cells.

Can someone please tell me how can I correct this problem s.t. when the

loop
is complete, all rows' height are correctly adjusted with its max lines of
wrapped text displayed ?

Thanks in advance for any assistance.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set a minimum row height a the same time with autofit row height Julie B New Users to Excel 2 May 5th 23 07:44 PM
Autofit height jdenegal Excel Worksheet Functions 1 March 5th 10 10:06 PM
Autofit - But At Least a Certain Height Susan Excel Discussion (Misc queries) 3 October 23rd 08 09:30 PM
Autofit row height Odie Excel Discussion (Misc queries) 7 April 12th 08 07:25 PM
Need a row to autofit height after it's value changes Rob E[_2_] Excel Discussion (Misc queries) 6 June 20th 07 08:00 PM


All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"