Laurence D
New Member
- Joined
- Sep 14, 2016
- Messages
- 31
Hello experts,
I have a workbook with the same kind of data in about 30 different worksheet tabs. I want to make all of the rows with data in each worksheet be reformatted with a row height of 30, unless the content is larger than 30 then it needs the entire row to be autofitted. I have code that works for one active sheet.
But want I need help with is additional code that will make my code work with all worksheets in this workbook.
Can anybody help with this? Here is my code so far:
Thanks all,
I have a workbook with the same kind of data in about 30 different worksheet tabs. I want to make all of the rows with data in each worksheet be reformatted with a row height of 30, unless the content is larger than 30 then it needs the entire row to be autofitted. I have code that works for one active sheet.
But want I need help with is additional code that will make my code work with all worksheets in this workbook.
Can anybody help with this? Here is my code so far:
Code:
[COLOR=#000000][FONT=Menlo]Sub MinimumRow_Plus_Autofit()[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[COLOR=#000000][FONT=Menlo] Application.ScreenUpdating = [COLOR=#011993]False[/COLOR][/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo][COLOR=#011993]For[/COLOR] [COLOR=#011993]Each[/COLOR] c [COLOR=#011993]In[/COLOR] Range("A1:A300")[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo] c.EntireRow.AutoFit[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo] [COLOR=#011993]If[/COLOR] c.RowHeight < 30 [COLOR=#011993]Then[/COLOR] c.RowHeight = 30[/FONT][/COLOR]
[COLOR=#011993][FONT=Menlo]Next[COLOR=#000000] c[/COLOR][/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[COLOR=#000000][FONT=Menlo]Application.ScreenUpdating = [COLOR=#011993]True[/COLOR][/FONT][/COLOR]
[COLOR=#011993][FONT=Menlo]End[COLOR=#000000] [/COLOR]Sub[/FONT][/COLOR]
Thanks all,