Is it possible to use row.autofit while ignoring a specific column?

vbaNumpty

Board Regular
Joined
Apr 20, 2021
Messages
171
Office Version
  1. 365
Platform
  1. Windows
I am using the following code to tidy a spreadsheet in the automation of a dashboard, adjusting the row height.

VBA Code:
addMe.Offset(n, 6).Rows.AutoFit

where addMe and n are changing variables that move down the sheet as new information is pasted.

Essentially what I want is to do an autofit on the value in the cell that the offset is finding, but it is currently doing the entire row which I don't particularly want it to do. Specifically the text in column A. I really would prefer a method that would enable me to only autofit the row height if the value in the offset cell calls for it, right now it is also autofitting the values in column A that are sometimes larger when I don't want it to.

Thanks.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Fraid not, the row height is the same for the entire row & that cannot be changed.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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