+ Reply to Thread
Results 1 to 8 of 8

UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    Largo, FL
    MS-Off Ver
    2016
    Posts
    12

    Unhappy UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    Good Morning!

    Racking my head on this one: I created a basic user-form that is set to show when cell H1 = TRUE. Works great, looks great. However, when you click the command button on the userform to close (using the Unload command), it closes and then just pops up again because H1 still = TRUE. What I want it to do is close and not re-open unless any cells in the ranges A1:B10 or D1:D10 are changed after the userform has been closed.

    This has to be easy, right?

    Thanks so much in advance!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    Do you mean the userform shows when H1 is changed to TRUE or is there another process that looks if H1 = TRUE and opens the form if it is?

    As per mehmetcik's post above, would be helpful to see the workbook so we can see it in context.

    BSB

  4. #4
    Registered User
    Join Date
    06-15-2015
    Location
    Largo, FL
    MS-Off Ver
    2016
    Posts
    12

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    Mocking it up now, will post

  5. #5
    Registered User
    Join Date
    06-15-2015
    Location
    Largo, FL
    MS-Off Ver
    2016
    Posts
    12

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes



    OK, I'm an idiot. The mock-up worked just fine, so I went back and took a good look at my code on the Main Worksheet to trigger the userform,

    Private Sub Worksheet_Change(ByVal Target As Range)

    Turns out I had it nested inside another code which checks specific criteria in a loop, so every time I would close the userform, it didn't matter since it had become part of the loop.

    Moved the userform trigger all the way to the bottom after the last End If and before End Sub, and now everything works as it should.

    Jees man, I spent hours trying to figure out what the heck was going on. No wonder Google wasn't finding anything lol

    Lesson learned! There should be a Best Practices or Dumb Mistakes list somewhere :P
    Last edited by Lynx_TWO; 08-12-2018 at 10:41 AM.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    Important thing is it's all sorted now and you've learned something.

    You could have spent many more hours on it before finding the issue...

    BSB

  7. #7
    Registered User
    Join Date
    06-15-2015
    Location
    Largo, FL
    MS-Off Ver
    2016
    Posts
    12

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    True! I'll be sure to try isolating incidents in a mockup in the future. The tool I'm developing has just gotten really extensive, so it's getting easier and easier to make dumb mistakes :D

    Thanks again!

    -Dan

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: UserForm pops up when a cell = TRUE, don't show again once closed until a cell changes

    Quote Originally Posted by Lynx_TWO View Post
    The tool I'm developing has just gotten really extensive, so it's getting easier and easier to make dumb mistakes :D
    That's often how these things turn out. Solution there is meticulous planning before you even touch the keyboard and start building the thing!
    Learned that lesson the hard way myself...

    BSB

+ 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. How to have checkbox stay True when userform is closed and reopened
    By Gal403 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2014, 12:57 PM
  2. Message box to show cell value from a different (closed) WorkBook
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2011, 08:58 AM
  3. Show command Button on worksheet when cell = True
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-20-2009, 05:08 PM
  4. Make a MsgBox show the value of a cell in a closed workbook
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2006, 10:52 AM
  5. Conditional Formating a cell .. to Show Nothing .. if True
    By monir in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2006, 04:40 AM
  6. How do I show True as a value in Excel B2 if Cell B1 is bold?
    By Gary in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2006, 03:55 PM
  7. Show blank cell when not Closed or Open
    By roy.okinawa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-07-2005, 09:20 PM

Tags for this Thread

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