So I have a workbook with quite a few UserForms, as you go through the tool the choice of what form to go to next will change. So I would like them to be able to back out in the same order they went in. FYI there are 25 different forms and how they go through will be different. My thought to fix this is to use several cells as place holders to keep track of how they do this and use a Select to help figure out where they are and how many deep they have gone. (I hope that makes sense) here are the two vba I used one that is used every time they go one more deep in and one for when they are backing out. I am getting a no object found error on the backing out part, I feel like I am missing something small. Can you help, please?
VBA Code:
Private Sub CButtonEquipment_Click() ' Going in
Select Case Sheets("ActiveDataCab").Cells(12, 4)
Case 0
Sheets("ActiveDataCab").Cells(13, 4).Value = Me.Name
Case 1
Sheets("ActiveDataCab").Cells(14, 4).Value = Me.Name
Case 2
Sheets("ActiveDataCab").Cells(15, 4).Value = Me.Name
Case 3 Or higher
Sheets("ActiveDataCab").Cells(16, 4).Value = Me.Name
End Select
Unload Me
UFv5Equipment1.Show
End Sub
VBA Code:
Private Sub CBExit3_Click() 'Backing out
Dim UF1 As Object
Select Case Sheets("ActiveDataCab").Cells(12, 4)
Case 0
Unload Me
UFv5Main1.Show
Case 1
Set UF1 = Sheets("ActiveDataCab").Cells(13, 4).Value
Unload Me
UF1.Show
Sheets("ActiveDataCab").Cells(13, 4).ClearContents
Case 2
Set UF1 = Sheets("ActiveDataCab").Cells(14, 4).Value
Unload Me
UF1.Show
Sheets("ActiveDataCab").Cells(14, 4).ClearContents
Case 3
Set UF1 = Sheets("ActiveDataCab").Cells(15, 4).Value
Unload Me
UF1.Show
Sheets("ActiveDataCab").Cells(15, 4).ClearContents
Case Is >= 4
Set UF1 = Sheets("ActiveDataCab").Cells(16, 4).Value
Unload Me
UF1.Show
Sheets("ActiveDataCab").Cells(16, 4).ClearContents
End Select
End Sub