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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Fraid not, the row height is the same for the entire row & that cannot be changed.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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