Hi, i tried to solve a problem appeared to me before and another came up.
I have set a UserForm with ComboBox for multiple selection items. I use 4-5 subroutines in a row so the UserForm user to select a specific value. Depended ComboBox in other words. The error i get is that of "Subscript out of range". I know it has to do with the Activation/Selection proper use of the workbooks/sheets/rows/columns, but the various changes I've done all lead me to wrong results.
Particularly, if in the second subroutine instead of .select i use .activate, the third subroutine gives wrong results. In what way you switch among the open workbooks?
The subroutines i use:
i get the error in the second subroutine in the wb1 .Sheets("En_mob").Activate part.
I have set a UserForm with ComboBox for multiple selection items. I use 4-5 subroutines in a row so the UserForm user to select a specific value. Depended ComboBox in other words. The error i get is that of "Subscript out of range". I know it has to do with the Activation/Selection proper use of the workbooks/sheets/rows/columns, but the various changes I've done all lead me to wrong results.
Particularly, if in the second subroutine instead of .select i use .activate, the third subroutine gives wrong results. In what way you switch among the open workbooks?
The subroutines i use:
i get the error in the second subroutine in the wb1 .Sheets("En_mob").Activate part.
Code:
'First subroutine
Sub ActivateBelgium()
Set wb1 = Workbooks.Open(Filename:="C:\Users\Zyklon\Desktop\1st\BE_ACTIVITIES_MOBILE_new.xls")
Windows("BE_ACTIVITIES_MOBILE_new.xls").Activate
Set wb2 = Workbooks.Open(Filename:="C:\Users\Zyklon\Desktop\1st\BE_CONTROL_VINTAGE_new.xls")
Windows("BE_CONTROL_VINTAGE_new.xls").Activate
'Workbooks.Open Filename:="C:\Users\Zyklon\Desktop\1st\BE_EMFACTORS.xls"
End Sub
'Second Subroutine
Sub ActivateHDB()
With wb1
.Sheets("En_mob").Activate
Range("G:G").Select
End With
With wb2
.Sheets("Penetr_MOB_RD").Activate
Rows("4:22").Select
End With
End Sub
'Third Subroutine
Sub Activate1990()
With wb1
Selection.Rows("4:11").Select
End With
With wb2
Selection.Columns(4).Select
End With
End Sub