Hey folks,
I have been trying to create a macro that will either create a single workbook, or loop through a list a create a workbook for each name in the list. The range is called "Physical Site" and is really a European country in this case.
It will create a single workbook. The issue occurs when the macro gets to the Option Buttons ("ALL") line. I have tried to research but cannot figure out the issue. Any help would be greatly appreciated.
By the way, this macro sequence was taken from another workbook and trying to adapt to this report.
Sub WesternEuropeReport()
Dim Row As Integer
Row = 7
If wsControl.CheckBoxes("ScreenUpdate") = xlOn Then
Application.ScreenUpdating = True
Else
Application.ScreenUpdating = False
End If
If wsControl.OptionButtons("ONE") = xlOn Then
Call FilterPivot1
Call FilterPivotPS1v2
Call FilterFTEPivot
Call RefreshAllPivots
Call DeleteFTEs
Call CopyFTEs
Call BackToControl
End If
If wsControl.CheckBoxes("RefreshOnly") = xlOn Then
wsControl.Activate
Range("A1").Select
Exit Sub
Else
Call CreateNewReport
Call DeleteSheets
End If
wsControl.Activate
Range("AN7").Select
End If
If wsControl.CheckBoxes("RefreshOnly") = xlOn Then
MsgBox "All Physical Sites in not an option when Refresh Only is selected"
End If
'wsControl.Range("gRef") = 1
Do While wsControl(Row, 40).Value <> NullString
Range("PhysicalSite") = Cells(Row, 40)
Call FilterPivot1
Call FilterPivotPS1v2
Call FilterFTEPivot
Call RefreshAllPivots
Call DeleteFTEs
Call CopyFTEs
Call CreateNewReport
Call DeleteSheets
Row = Row + 1
Loop
End Sub
I have been trying to create a macro that will either create a single workbook, or loop through a list a create a workbook for each name in the list. The range is called "Physical Site" and is really a European country in this case.
It will create a single workbook. The issue occurs when the macro gets to the Option Buttons ("ALL") line. I have tried to research but cannot figure out the issue. Any help would be greatly appreciated.
By the way, this macro sequence was taken from another workbook and trying to adapt to this report.
Sub WesternEuropeReport()
Dim Row As Integer
Row = 7
If wsControl.CheckBoxes("ScreenUpdate") = xlOn Then
Application.ScreenUpdating = True
Else
Application.ScreenUpdating = False
End If
If wsControl.OptionButtons("ONE") = xlOn Then
Call FilterPivot1
Call FilterPivotPS1v2
Call FilterFTEPivot
Call RefreshAllPivots
Call DeleteFTEs
Call CopyFTEs
Call BackToControl
End If
If wsControl.CheckBoxes("RefreshOnly") = xlOn Then
wsControl.Activate
Range("A1").Select
Exit Sub
Else
Call CreateNewReport
Call DeleteSheets
End If
Code:
[B] If wsContol.OptionButtons("ALL") = xlOn Then [/B]"Run Time Error '424': Object required"
Range("AN7").Select
End If
If wsControl.CheckBoxes("RefreshOnly") = xlOn Then
MsgBox "All Physical Sites in not an option when Refresh Only is selected"
End If
'wsControl.Range("gRef") = 1
Do While wsControl(Row, 40).Value <> NullString
Range("PhysicalSite") = Cells(Row, 40)
Call FilterPivot1
Call FilterPivotPS1v2
Call FilterFTEPivot
Call RefreshAllPivots
Call DeleteFTEs
Call CopyFTEs
Call CreateNewReport
Call DeleteSheets
Row = Row + 1
Loop
End Sub