Auto fit row according to a specific column

jcg31

Board Regular
Joined
Aug 20, 2006
Messages
176
I have content in column 3 row 5 that would autofit to a row height of 18 pixels in column 8 the content would require 50 pixels (same row). I want the row to autofit to 18 pixels. Is there way to autofit a row according to a specific cell?

Thanks,
Jim
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
This macro inserts a blank row at row 6
Copies C5 to C6
Autofits row 6
Make the height of row 5 the same as row 6
Deletes row 6

Code:
Sub Autofit_Height_C5()
    Application.ScreenUpdating = False
        Rows(6).Insert
        Range("C6").Value = Range("C5").Value
        Rows(6).AutoFit
        Rows(5).RowHeight = Rows(6).RowHeight
        Rows(6).Delete
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,678
Members
452,937
Latest member
Bhg1984

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