Have been looking around to see if I could find the solution to my problem myself, but I have come up short..
Basically I am creating a userform containing 4 different check boxes, [4] optionbuttons & 1 commandbutton.
First Frame - Optionbutton5 (Column B onwards) , OptionButton6 (Column C onwards)
Second Frame - Optionbutton7 (Selected Sheet), OptionButton8 (All sheets)
Third Frame - CheckBox1 (Cover) , CheckBox2 (Trans_Letter), CheckBox3 (Abbreviations) CheckBox3 (Indexes)
This user form helps me to change the row and column width of activesheet OR all the worksheets in a workbook This userform has 3 frames:
1st frame: To select from which Column (B or C) you want to change the column width.
2nd frame : To select on which sheet you want to change the row height and column width ( On Active sheet or On All the sheets)
3rd frame : It has 4 checkboxes which contains name of 4 sheets in my workbook. Although there are close to 50 sheets in my workbook but I have created checkboxes for these specific 4 sheets because whenever needed I can select any of the checkbox and that sheet is excluded while changing the column width and row height of all the sheets.
I have developed macros to change the column width and row height from Column (B or C) and from activesheet and all the sheets and these macros work absolutely fine. Till now I am successful in linking my 1st and second frame (Eg : when I am selecting "Column B onwards" in first frame and "All Sheets " in second frame it is changing the column width and row height. Now I want to link my third frame that once I select "Column B onwards" in first frame and "All Sheets " in second frame and "Cover" in the third frame then it should change column width and row height of all the sheets except the Sheet name "Cover".
Can you help me with the code that whenever any of the checkboxes are TRUE then for that respective sheet the macro should not apply that is column and row height and width dosent change.
Module Codes:
Sub rowcolactivesheetb()
Dim exworkb As Workbook
Dim xlwksht As Worksheet
Dim lastrow1 As Long
Dim lastcolumn1 As Long
Dim firstrowDB As Long
With ActiveSheet
lastrow1 = .Cells(Rows.Count, "A").End(xlUp).Row
lastcolumn1 = .Cells(1, Columns.Count).End(xlToLeft).Column
.Range(.Cells(1, 2), .Cells(lastrow1, lastcolumn1)).Select
Selection.Cells.RowHeight = 9.4
Selection.Cells.ColumnWidth = 11.2
End With
End Sub
Sub rowcolallsheetb()
Dim exworkb As Workbook
Dim xlwksht As Worksheet
Dim lastrow1 As Long
Dim lastcolumn1 As Long
Dim firstrowDB As Long
Dim Z As Integer
Dim ShtNames() As String
ReDim ShtNames(1 To ActiveWorkbook.Sheets.Count)
For Z = 1 To ActiveWorkbook.Sheets.Count
ShtNames(Z) = Sheets(Z).Name
Sheets(Z).Activate
lastrow1 = Sheets(Z).Cells(Rows.Count, "A").End(xlUp).Row
lastcolumn1 = Sheets(Z).Cells(1, Columns.Count).End(xlToLeft).Column
ActiveWorkbook.Sheets(Z).Range(Sheets(Z).Cells(1, 2), Sheets(Z).Cells(lastrow1, lastcolumn1)).Select
Selection.Cells.RowHeight = 9.4
Selection.Cells.ColumnWidth = 11.2
Next Z
End Sub
Sub rowcolactivesheetc()
Dim exworkb As Workbook
Dim xlwksht As Worksheet
Dim lastrow1 As Long
Dim lastcolumn1 As Long
Dim firstrowDB As Long
With ActiveSheet
lastrow1 = .Cells(Rows.Count, "A").End(xlUp).Row
lastcolumn1 = .Cells(1, Columns.Count).End(xlToLeft).Column
.Range(.Cells(1, 3), .Cells(lastrow1, lastcolumn1)).Select
Selection.Cells.RowHeight = 9.4
Selection.Cells.ColumnWidth = 11.2
End With
End Sub
Sub rowcolactivesheetc()
Dim exworkb As Workbook
Dim xlwksht As Worksheet
Dim lastrow1 As Long
Dim lastcolumn1 As Long
Dim firstrowDB As Long
With ActiveSheet
lastrow1 = .Cells(Rows.Count, "A").End(xlUp).Row
lastcolumn1 = .Cells(1, Columns.Count).End(xlToLeft).Column
.Range(.Cells(1, 3), .Cells(lastrow1, lastcolumn1)).Select
Selection.Cells.RowHeight = 9.4
Selection.Cells.ColumnWidth = 11.2
End With
End Sub
Sub rowcolallsheetc()
Dim exworkb As Workbook
Dim xlwksht As Worksheet
Dim lastrow1 As Long
Dim lastcolumn1 As Long
Dim firstrowDB As Long
Dim Z As Integer
Dim ShtNames() As String
ReDim ShtNames(1 To ActiveWorkbook.Sheets.Count)
For Z = 1 To Sheets.Count
ShtNames(Z) = Sheets(Z).Name
Sheets(Z).Select
lastrow1 = Sheets(Z).Cells(Rows.Count, "A").End(xlUp).Row
lastcolumn1 = Sheets(Z).Cells(1, Columns.Count).End(xlToLeft).Column
ActiveWorkbook.Sheets(Z).Range(Sheets(Z).Cells(1, 3), Sheets(Z).Cells(lastrow1, lastcolumn1)).Select
Selection.Cells.RowHeight = 9.4
Selection.Cells.ColumnWidth = 11.2
Next Z
End Sub
Sub rowcolallsheetbcover()
Dim exworkb As Workbook
Dim xlwksht As Worksheet
Dim lastrow1 As Long
Dim lastcolumn1 As Long
Dim firstrowDB As Long
Dim Z As Integer
Dim ShtNames() As String
ReDim ShtNames(1 To ActiveWorkbook.Sheets.Count)
For Z = 1 To Sheets.Count
ShtNames(Z) = Sheets(Z).Name
If Sheets(Z).Name <> "Cover" Then
Sheets(Z).Select
lastrow1 = Sheets(Z).Cells(Rows.Count, "A").End(xlUp).Row
lastcolumn1 = Sheets(Z).Cells(1, Columns.Count).End(xlToLeft).Column
ActiveWorkbook.Sheets(Z).Range(Sheets(Z).Cells(1, 2), Sheets(Z).Cells(lastrow1, lastcolumn1)).Select
Selection.Cells.RowHeight = 9.14
Selection.Cells.ColumnWidth = 7.14
End If
Next Z
End Sub
Private Sub CommandButton1_Click()
If Me.OptionButton5.Value = True Then
If Me.OptionButton7.Value = True Then
Call rowcolactivesheetb
End If
End If
If Me.OptionButton6.Value = True Then
If Me.OptionButton7.Value = True Then
Call rowcolactivesheetc
End If
End If
If Me.OptionButton5.Value = True Then
If Me.OptionButton8.Value = True Then
If Me.CheckBox1.Value = True Then
Call rowcolallsheetbcover
Else
Call rowcolallsheetb
End If
End If
End If
If Me.OptionButton6.Value = True And _
Me.OptionButton8.Value = True And _
Me.CheckBox1.Value = False And _
Me.CheckBox2.Value = False And _
Me.CheckBox3.Value = False And _
Me.CheckBox4.Value = False Then
Call rowcolallsheetc
End If
If Me.OptionButton6.Value = True And _
Me.OptionButton8.Value = True And _
Me.CheckBox1.Value = True Then
Call rowcolallsheetccover
End If
If Me.OptionButton6.Value = True And _
Me.OptionButton8.Value = True And _
Me.CheckBox2.Value = True Then
Call rowcolallsheetctransletter
End If
End Sub

Truethen the sheet should be formatted (just like you have it in your code).OptionButtonmeans what (e.g. what doesOptionButton6represent). But I am assuming thatrowcolallsheetbcoverwill format all sheets. If you adjust the code for that sub to exclude whatever you have checked on your form then you are done. So, basically you'll have to edit the macrorowcolallsheetbcover(assumed).