Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2008
    Location
    LOUISVILLE, Kentucky, USA
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    update to worksheet 1 (vb/vba / excel)

    Question: How do I have the user's go back to userform 1 if they answer yes.

    the name of the user form 2 is FRMHOLDBOOK2.

    I tried -
    <code>
    If X = vbYes Then FRMHOLDBOOK2.SHOW
    </code>




    <code>
    Private Sub cmdAdd_Click()
    Dim strValue As String
    Dim rng As Range
    Dim iRow As Long
    Dim myDate As Date, newDate As Date, oldSheet As String, newSheet As String
    Dim WS As Worksheet
    Set WS = Worksheets(Worksheets.Count)
    strValue = Me.txtSdnumber

    Dim Sht As Worksheet, foundSheet As Boolean
    Application.ScreenUpdating = False
    Sheets(Worksheets.Count).Select
    Cells(1, 1).Select
    Application.ScreenUpdating = True

    Dim X
    X = MsgBox("Any more Jobs to be held?", vbYesNo)
    If X = vbNo Then MsgBox "THANK YOU, PLEASE HIT THE EXIT BUTTON IF DONE"

    End Sub

    Private Sub cmdCLEar_Click()
    'clear the data

    Me.txtJobnames.Value = ""
    Me.txtSdnumber.Value = ""
    Me.txtRequestor.Value = ""
    Me.txtINitials.Value = ""
    Me.txtCOmment.Value = ""
    Me.txtJobnames.SetFocus
    End Sub

    Private Sub cmdClose_Click()
    Unload Me
    MsgBox "Thank you, Please come again"

    End Sub

    </code>


    ANY IDEAS

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: update to worksheet 1 (vb/vba / excel)

    Try

    X = MsgBox("Any more Jobs to be held?", vbYesNo)
    If X = vbNo Then
    MsgBox "Thank you, please click Exit if you're done."
    Else
    ' Optional - close second userform
    Unload Me ' or Me.Hide
    ' Show first userform
    FRMHOLDBOOK2.Show
    End If

Posting Permissions

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