AutoFit Column ("F")

Livin404

Well-known Member
Joined
Jan 7, 2019
Messages
743
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Greetings,

I'm confident this is so much easier than my last post which fortunately I was able to sort out myself.

I want to include a line in an existing Macro to auto fit a column where I have an existing Macro, so I don't have to create an extra one.

My current Macro is:

VBA Code:
Sub Delete_Columns()
    Columns("G:I").EntireColumn.Delete
End Sub

I want to autofit Column F. I concatenated cells F through I leaving only Column F with text. Then I deleted Columns "G:I". Now I just need to extend the length of Column F.

Thank you so much!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Did you try recording a macro to do that?

It was too easy, I just simply added, and it worked fine. Thank you
Excel Formula:
 Range("F1").EntireColumn.AutoFit
 
Last edited by a moderator:
Upvote 0
Did you try recording a macro to do that?
Sorry about that. Spent a lot of time working on other parts in VBA, and didn't think it would be as straight forward. Your response made me try the obvious. Thank you,
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,215,586
Messages
6,125,687
Members
449,249
Latest member
ExcelMA

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