a little help with an non critical but annoying error

  • Thread starter Thread starter DawnTreader
  • Start date Start date
D

DawnTreader

Hello All

ActiveWorkbook.Worksheets("Dashboard").Columns("E:E").EntireColumn.AutoFit

do i need to do the entire column? or does the E:E take care of that?

sometimes it comes up with an error saying that the range isnt available for
autofit, or something like that.

any and all help appreciated.
 
Try
ActiveWorkbook.Worksheets("Dashboard").Columns(5).EntireColumn.AutoFit

If this post helps click Yes
 
Jacob
========
You don't need the EntireColumn reference since the Columns property
provides that...

ActiveWorkbook.Worksheets("Dashboard").Columns(5).AutoFit

Dawn
=======
Just so you know, you can use the column letter instead of the column number
code if you prefer...

ActiveWorkbook.Worksheets("Dashboard").Columns("E").AutoFit
 
Thanks Rick..

Rick Rothstein said:
Jacob
========
You don't need the EntireColumn reference since the Columns property
provides that...

ActiveWorkbook.Worksheets("Dashboard").Columns(5).AutoFit

Dawn
=======
Just so you know, you can use the column letter instead of the column number
code if you prefer...

ActiveWorkbook.Worksheets("Dashboard").Columns("E").AutoFit
 
Back
Top