Results 1 to 8 of 8

Goto statment or IF Then End Sub

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    Goto statment or IF Then End Sub

    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,
    Last edited by TheNewGuy; 07-09-2009 at 04:00 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1