Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto Row Height with Wrapped Text in Merged Cells Problem | Excel Discussion (Misc queries) | |||
How to enable auto height with merged cells? | Excel Worksheet Functions | |||
Auto Row Height in Merged Cells with pre exisiting text | Excel Worksheet Functions | |||
Solution To Auto Height For Merged Cells | Excel Programming | |||
Auto Row Height for Merged Cells | Excel Programming |