LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Auto row height for merged cells


Jim,

I'm not sure why that is not working for me.

Since I'm new to VBA, can you provide the whole routine I can cut and
paste into my worksheet code?
I tried:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Rows.autofit
End Sub

I really don't understand what the 1st line actually does yet.
I assume it looks at a current selection when the enter key is pressed
or you navigate away from it.

I'll be getting a book on VBA if I don't get one for Christmas.
For now I am learning as I go.

On Dec 11, 10:38 am, Jim Jackson
wrote:
'The line:
Rows.autofit
' should give you the proper row height.

You can always specify the row number if desired:
Rows(12).Autofit

--
Best wishes,

Jim



"RealmSteel" wrote:
I've got a sheet that has a bunch of user inputted information in the top
portion.
The lower portion is for a message.
A lot like a Fax cover letter.


For each row in the lower portion with the meassge, I have columns B thru L
merged. I don't expect the sheet to be more than 3 or 4 pages long max when
printed.


I am looking to create some code that will automatically adjust the row
height for the merged cells if the user types a sentance too long.


Another problem I have is if I merge a bunch of rows (say 50), it will print
these rows even though no data is in them. I need to prevent that from
happening.
I only want ot print as many pages as needs with out waste.


I'm very new to VBA, but found this link during a search.
http://groups.google.com/group/micro...rogramming/bro...


I haven't tried it yet, but I know I would need to modify it to search for
all cells below say 16 and adjust row height as needed.


Is there any newer code out there for doing this?
Also, is there a way to do this automatically so the row is adjusted right
when the user hits enter or navigates to a different cell?


Is there a way to automatically adjust the print area without having to
create a button?
I created a button to print the log for these sheets, but was hoping to be
able to just allow the user to use the normal printer icon.


Thanks,
Rich- Hide quoted text -- Show quoted text -


 
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
Auto Row Height with Wrapped Text in Merged Cells Problem Rick Cl. Excel Discussion (Misc queries) 3 June 3rd 10 11:21 PM
How to enable auto height with merged cells? lgreggs Excel Worksheet Functions 0 March 18th 10 03:29 PM
Auto Row Height in Merged Cells with pre exisiting text gwinder Excel Worksheet Functions 2 December 14th 06 05:31 PM
Solution To Auto Height For Merged Cells JoJo Excel Programming 0 August 16th 06 10:58 PM
Auto Row Height for Merged Cells Jamie Excel Programming 13 July 1st 05 12:55 AM


All times are GMT +1. The time now is 04:34 PM.

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"