Autosize Rows in Named range

Chewyhairball

Active Member
Joined
Nov 30, 2017
Messages
312
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a named range called "Summary Table" that I would like to Autofit the row height to the data that is typed in.
Sometimes its just a few words and other times might be a few sentences.

any ides?

thanks

Rory
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
try
VBA Code:
Range("SummaryTable").Rows.AutoFit
 
Upvote 0
Hi No Sparks

Where would I put that for it to trigger when I type into one of the cells in the range. Worksheet Change event?

Thanks

Rory
 
Upvote 0
Hi

I already have a worksheet change event and I added it to the beginning of that, however I am getting this error now!?

1633445063572.png
 
Upvote 0
Post your code for us to see.
 
Upvote 0
Post your code for us to see.
It works in the first column of the range so Im pretty sure it is today with the other columns being merged cells...is it possible to do it on merged cells?
 
Upvote 0
It works in the first column of the range so Im pretty sure it is today with the other columns being merged cells...is it possible to do it on merged cells?
Get rid of the merged cells, if at all possible!!!
Merged cells cause all sorts of problems with VBA and other things, like sorting (it may be possibly the worst feature ever designed in Excel).
So most people will avoid them like the plague!

If you are just trying to align multiple cells across single rows, you can accomplish the same visual effect by using the "Center Across Selection" formatting option instead.
See: Tom’s Tutorials For Excel: Using Center Across Selection Instead of Merging Cells – Tom Urtis
 
Upvote 0
Solution
Get rid of the merged cells, if at all possible!!!
Merged cells cause all sorts of problems with VBA and other things, like sorting (it may be possibly the worst feature ever designed in Excel).
So most people will avoid them like the plague!

If you are just trying to align multiple cells across single rows, you can accomplish the same visual effect by using the "Center Across Selection" formatting option instead.
See: Tom’s Tutorials For Excel: Using Center Across Selection Instead of Merging Cells – Tom Urtis
All I can say is wow! Centre across selection!!

Works perfectly! :)

thank you
 
Upvote 0
You are welcome.
Glad that worked for you.
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top