+ Reply to Thread
Results 1 to 3 of 3

Defining a Label

  1. #1
    Richard
    Guest

    Defining a Label

    I'm trying to send code from a CommandButton2 to Workbook Open. Example:
    If Commandbutton2 is "clicked", (which is on a UserForm) then GoTo Workbook
    Open() Inputagain: Exit Sub


  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    command button

    Just copy the inputagain:macro and paste in the command button code, don't send it back to workbook open :

  3. #3
    Richard
    Guest

    Re: Defining a Label

    I need to some how send a message to my other code which is in the Workbook
    open() and tell it to Exit Sub before the other code is executed. Example: If
    Commandbuttonw2 is clicked then go to Inputagain which will Exit Sub before
    the rest of the code is executed. Don't want anything executed after
    "Inputagain" if Commandbutton2 is clicked.
    L = Month(Date) * 10000 + Year(Date)
    M = GetSetting("Demo", "Drafts", "Month", 0)
    If L = M Then Exit Sub
    If Month(Date) = 4 Then
    If Day(Date) >= 24 And Day(Date) < 27 Then
    UserForm1.Show
    Inputagain: Exit Sub 'Here is the problem!
    If MsgBox("Do you qualify for Bank Day?", _
    vbYesNo) = vbYes Then
    MsgBox ("1 Day has been added to your Bank Days")
    Call SaveSetting("Demo", "Drafts", "Month", L)
    Worksheets("Vacation").Range("C3").Value = 1
    Else
    Worksheets("Vacation").Range("C3").Value = 0
    End If
    End If
    End If




    "davesexcel" wrote:

    >
    > Just copy the inputagain:macro and paste in the command button code,
    > don't send it back to workbook open :
    >
    >
    > --
    > davesexcel
    > ------------------------------------------------------------------------
    > davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
    > View this thread: http://www.excelforum.com/showthread...hreadid=516639
    >
    >


+ Reply to Thread

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