Here is the code, I will try to break it out so you can see the steps....
Dim Occ2Num as Integer - Occ2Num counts how many times Sheet("Model") is viewed
Dim Occ3Num as Integer - Occ3Num counts how many times Sheet("Regional") is viewed
Private Sub Workbook_Open()
MainSelection.Show
End Sub
Private Sub RunComp_Click()
Occ2Num = Occ2Num + 1
Unload Me
MsgBox ("To begin use the highlighted input cells to select a Base, Comp 1 and Comp 2 property. Or see the Comp Chart to view comparable properties and make selections.")
End Sub
Private Sub RunReg_Click()
Worksheets("Regional").Select
Range("A1").Select
Occ3Num = Occ3Num + 1
Unload Me
MsgBox ("To begin use the highlighted cells to select a Company, Region and Unit Size and then Press the 'Process Request' button.")
MsgBox ("A property may have more than one unit type of a selected size. Use the drop downs below the Association name to view other unit types of the same size.")
End Sub
At this point you are now in one of the two sheets. The next two parts navigate from one sheet to the other once the workbook is loaded.
Sub toregional()
If Occ3Num = 0 Then
Worksheets("Regional").Select
Range("A1").Select
MsgBox ("To begin use the highlighted cells to select a Company, Region and Unit Size and then Press the 'Process Request' button.")
MsgBox ("A property may have more than one unit type of a selected size. Use the drop downs below the Association name to view other unit types of the same size.")
Occ3Num = Occ3Num + 1
Else
Worksheets("Regional").Select
Range("A1").Select
End If
End Sub
Sub tomodel()
'
If Occ2Num = 0 Then
Sheets("Model").Select
Range("A1").Select
MsgBox ("To begin use the highlighted input cells to select a Base, Comp 1 and Comp 2 property. Or see the Comp Chart to view comparable properties and make selections.")
Occ2Num = Occ2Num + 1
Else
Sheets("Model").Select
Range("A1").Select
End If
End Sub
So it works perfect except for the fact that the one you select in the form will prompt again when navigated to via the macro. But it will only do it one more time.
Bookmarks