+ Reply to Thread
Results 1 to 3 of 3

Close UserFom if cell formatting doesn't match

  1. #1
    Registered User
    Join Date
    01-31-2017
    Location
    Shenzhen
    MS-Off Ver
    2013
    Posts
    27

    Close UserFom if cell formatting doesn't match

    Hello Everyone,

    Following situation: I open an UserForm (particularly a calendar) by clicking a cell which matches the formatting (d mmm yy) with the following code:

    Please Login or Register  to view this content.
    To close the UserForm I have to click the close button on the right top corner.
    Question: is it possible to close the UserFform by clicking any cell which does not have the same formatting or by clicking another cell with the matching formatting then the UserForm will close and reopen? Not sure if this is possible in general, please let me know.

    Many thanks,
    Stefan

  2. #2
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Close UserFom if cell formatting doesn't match

    Just a thought.
    Could this be of help?

    Please Login or Register  to view this content.
    use this if you only want a range of cells to be checked.

    Please Login or Register  to view this content.
    I also uploaded the sample workbook with a sample userform.
    The ShowModal attribute in the properties window is set to : FALSE.
    This will give you a userform on top, but the sheet is still available.

    I used a format BOLD and color RED to get the format of a selected cell.
    If TRUE then the UserForm is closed.
    IF FALSE the UserForm will be opened.
    Attached Files Attached Files
    Last edited by MarMo; 07-04-2018 at 07:47 AM.
    Even a little help can be a big help !!
    1. A sample workbook says more then words. Add problem description and solution so we can understand the problem.
    2. Your appreciation is accepted by clicking the star "Add Reputation" at the lower left of the post.
    3. If your problem is solved, mark it as [SOLVED]: See "FAQ : " https://www.excelforum.com/faq.php
    4. Use [CODE] [/CODE] tags to illustrate your code: see here

  3. #3
    Registered User
    Join Date
    01-31-2017
    Location
    Shenzhen
    MS-Off Ver
    2013
    Posts
    27

    Re: Close UserFom if cell formatting doesn't match

    Hi MarMo,

    Thanks a lot for your help. The ShowModal attribute was what I was looking for.

+ 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] Change background colour to yellow if cell doesn't match the previous cell
    By drzeto in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2017, 05:33 PM
  2. [SOLVED] Formatting doesn't save when I close my spreadsheet
    By cara164 in forum Excel General
    Replies: 3
    Last Post: 11-19-2014, 05:07 PM
  3. Replies: 3
    Last Post: 02-26-2014, 11:07 AM
  4. Formula to add rows if cell 2,1 doesn't match 3,1
    By flintcs in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-09-2013, 04:05 PM
  5. Replies: 5
    Last Post: 09-27-2010, 08:17 AM
  6. Save and Close Button on an excel userfom
    By Ruis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-05-2010, 06:30 PM
  7. [SOLVED] screen view doesn't match what's in the cell
    By paulcasciani in forum Excel General
    Replies: 0
    Last Post: 07-13-2006, 01:25 PM

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