VBA Code to AutoFit rows columns and entire worksheet || Excel Tricks

preview_player
Показать описание
In this tutorial, let us learn about VBA Code to AutoFit rows, columns and entire worksheet in Excel

This is the sample small data I am considering in this video now.

👀 Best Laptops to use for better speed:

1. Autofit a Column

Sub vba_autofit()
Columns(2).AutoFit
End Sub

2. Autofit a Row

Sub vba_autofit()
Rows(12).AutoFit
End Sub

3. AutoFit a Range

Sub vba_autofit()
ActiveSheet.UsedRange.EntireColumn.AutoFit
ActiveSheet.UsedRange.EntireRow.AutoFit
End Sub

4. AutoFit Entire Worksheet

Sub vba_autofit()
Worksheets("Sheet1").Cells.EntireColumn.AutoFit
Worksheets("Sheet1").Cells.EntireRow.AutoFit
End Sub

📒Our Recommendations
***************************************************************

If you found this video valuable, give it a like. If you know someone who needs to see it, share it. Leave a comment below with your thoughts. Add it to a playlist if you want to watch it later.

***********************************************

⚡️Tools for YouTube vlogging:
***********************************************
***********************************************

⚡️You Can Connect with Me at:
***********************************************

#dptutorials #autofit #excelautofit #exceltraining #exceltricks #exceltips #excelfreetraining #excelfreelearning

⚡️Tags: -
excel formulas in english, excel in english, excel tutorial in english,ms excel in english,ms excel tutorial in english, learn excel in english,vlookup in excel in english, learn ms excel in english, excel training, excel tutorial, microsoft excel 2007, learn excel,tutorial excel, ms excel tutorial, excel tutorials,ms excel 2007,microsoft excel training,learn excel online,learning excel,free excel training,online excel training,advanced excel tutorial,excel tutorial, excel formulas and functions, excel formulas, excel tutorial in hindi, excel formulas and functions in hindi, excel tricks, excel in hindi, excel shortcut keys, excel vlookup, excel formulas in hindi, excel for beginners, excel for accounting, excel formulas and functions tutorial, excel sum formula, sum formula series, excel attendance sheet, excel salary sheet, excel stock maintain, excel data entry, advanced excel tutorial,excel formulas,excel tutorial,vlookup excel,excel accounting,excel for beginners,excel shortcut keys,excel sum formula,excel training,excel training online,excel tricks,free excel training,learn excel,learn excel online,microsoft excel

🎁Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!
Рекомендации по теме
Комментарии
Автор

How can use the same function for merged cells and if we have to wrap text ? Can u show it ?

jeeveshbaliya
Автор

thx Bhai, I do not get the code working properly when excel opens an extract from the source data when I double click in a pivot table. then Excel opens a new sheet with details. I try to auto fit this sheet as well, but it does not work. Do you have a solution?
thx in advance Rob

robd