I need a macro that will show a userform if the value of any of three possible chekbox's is true. However if more than 1 checkbox is true I still only need the userform to be shown once. I have tried a few things and am stuck. I think a goto command would work, or if I could simply say If-then-End Sub, but I guess you cant do that. So here is what I have so far, please help if you can, I need to use this for a few different userforms so it is a big stumbling block for me right now. and any help would be greatly appreciated.
Public Sub roundprocessuserformcall()
Dim roughround As Integer
Dim finishround As Integer
finishround = 0
roughround = 0
If R_Router_Setup.Blanking.Value = True Then
Blanking.Show
R_Router_Setup.Blanking.Value = False
End If
If R_Router_Setup.RoughMachiningDiameter.Value = True Then
Call RoundRoughDiminsions(roughround)
End If
If R_Router_Setup.RoughMachineLength.Value = True Then
Call RoundRoughDiminsions(roughround)
End If
If R_Router_Setup.Dead_Center.Value = True Then
End If
If R_Router_Setup.Finishmachinglength.Value = True Then
Call RoundFinishDiminsions(finishround)
End If
If R_Router_Setup.Finish_machine_Diameter.Value = True Then
'RoundFinishMachine.Show
Call RoundFinishDiminsions(finishround)
End If
If R_Router_Setup.RoughButtonHead.Value = True Then
End If
If R_Router_Setup.Finishbuttonhead.Value = True Then
End If
If R_Router_Setup.threading.Value = True Then
End If
If R_Router_Setup.RoughGage.Value = True Then
'RoundRoughMachine.Show
Call RoundRoughDiminsions(roughround)
End If
If R_Router_Setup.Finishgage.Value = True Then
'RoundFinishMachine.Show
Call RoundFinishDiminsions(finishround)
End If
If R_Router_Setup.Machine_Notches.Value = True Then
End If
If R_Router_Setup.Polishing.Value = True Then
End If
If R_Router_Setup.InertiaWeld.Value = True Then
End If
If R_Router_Setup.Tumble.Value = True Then
End If
If R_Router_Setup.ShotPeen.Value = True Then
End If
End Sub
Public Sub RoundRoughDiminsions(roughround)
If roughround >= 1 Then End Sub
End If
If R_Router_Setup.RoughMachiningDiameter.Value = True Then
RoundRoughMachine.Show
End If
If R_Router_Setup.RoughMachineLength.Value = True Then
RoundRoughMachine.Show
End If
If R_Router_Setup.RoughGage.Value = True Then
RoundRoughMachine.Show
End If
roughround = roughround + 1
End Sub
Public Sub RoundFinishDiminsions(finishround)
If finishround >= 1 Then GoTo 10
End If
If R_Router_Setup.Finishmachinglength.Value = True Then
RoundFinishMachine.Show
End If
If R_Router_Setup.Finish_machine_Diameter.Value = True Then
RoundFinishMachine.Show
End If
If R_Router_Setup.Finishgage.Value = True Then
RoundFinishMachine.Show
End If
finishround = finishround + 1
10 End Sub
If you need any more info let me know, but the first sub checks the vaue of a previous userform,and if true calls 1 of 2 subs that determine if the other userform has been called yet, if so the ends the sub, or if not it shows the second userform, ....
Also if you know of a better way to do this please let me know,
Thanks for your time,
Bookmarks