+ Reply to Thread
Results 1 to 12 of 12

Return to userform after msgbox?

  1. #1
    Registered User
    Join Date
    02-05-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Return to userform after msgbox?

    I want to return to the userform if the msgbox occurres (then a text / listbox is empty) so the textbox can be filled before populating the data to the worksheet.

    Can anyone help me please?

    Please Login or Register  to view this content.
    Last edited by dbjofo; 02-06-2014 at 11:26 AM.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Return to userform after msgbox?

    It looks like you want something like

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    02-05-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Return to userform after msgbox?

    Hi mikerickson.

    Then I get a Compile error: Else without If

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Return to userform after msgbox?

    You may replace your If line with this code:
    Please Login or Register  to view this content.
    Last edited by Izandol; 02-06-2014 at 12:48 PM.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  5. #5
    Registered User
    Join Date
    02-05-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Return to userform after msgbox?

    Sorry that doesnt work either.

    With this code I dont even get a msgbox! And the data from the textboxes are inserted in the worksheet even though I want to wait until all textboxes are filled!
    Last edited by dbjofo; 02-06-2014 at 12:06 PM.

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Return to userform after msgbox?

    Please provide a sample workbook.

  7. #7
    Registered User
    Join Date
    02-05-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Return to userform after msgbox?

    Sample.xlsmHere you go

    Thank you so much
    Last edited by dbjofo; 02-06-2014 at 12:46 PM.

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Return to userform after msgbox?

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  9. #9
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Return to userform after msgbox?

    I apologise - it appears I missed a line when I copied the code parts from testing. I have corrected this - please copy the code again.

  10. #10
    Registered User
    Join Date
    02-05-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Return to userform after msgbox?

    GREAT!

    One last thing! I only need to have a value in either checkbox1 or checkbox2

    How do I fix this?

  11. #11
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Return to userform after msgbox?

    Perhaps this:
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    02-05-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Return to userform after msgbox?

    Andy this is great!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to unolad userform using msgbox
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-29-2013, 05:52 PM
  2. [SOLVED] Userform msgbox option to return to parent form
    By Hammer_757 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2012, 02:19 PM
  3. UserForm or MsgBox without code interruption?
    By Riggers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2011, 07:45 AM
  4. Substituting MsgBox with Userform
    By Volkanismo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-26-2011, 03:12 AM
  5. Adding MsgBox to Userform
    By buckchow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2007, 12:45 AM

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