+ Reply to Thread
Results 1 to 10 of 10

Pop up Box

  1. #1
    Registered User
    Join Date
    10-07-2008
    Location
    USA
    Posts
    30

    Pop up Box

    Here is the task I want to do.

    In cell a3 user selects yes or no. Then in cell b3, if they selected yes for a3, a pop up box should appear which asks for a value (1-100), and if they selected no for a3, then b3 automatically becomes zero. How can I do this.

    Thanks
    Last edited by saeed9313; 10-07-2008 at 02:00 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try this macro pasted into the appropriate sheet tab in the VBA editor (Alt F11)

    Please Login or Register  to view this content.
    Martin

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi mrice,

    Any reason why didn't you use Ucase?

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Or Option Compare Text

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    No reason not to use UCASE other than attempting to provide an example of the syntax should any further options need to be added at a later stage.

  6. #6
    Registered User
    Join Date
    10-07-2008
    Location
    USA
    Posts
    30
    Thanx, I will try both.

  7. #7
    Registered User
    Join Date
    10-07-2008
    Location
    USA
    Posts
    30
    Martin,

    How you actually run macro. I am trying to play it but it is asking me for macro name. I copied it VB module and saved it.

    Saeed

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    It's an event macro and the code goes in the sheet module.
    Right click the sheet tab > select view code > paste in the code

    Runs when cell A3 equals Yes

    VBA Noob

  9. #9
    Registered User
    Join Date
    10-07-2008
    Location
    USA
    Posts
    30

    More complications

    Thanks. I was able to run the macro. Now here is the complicated situation. I need to do same operation in various rows in different sheets of same workbook. I tried to duplicate this code but I am getting a message "Duplicate Decleration in Current Scope". Here is my example (R1... is row number and ( ) is the column). So cell A1 wold be "Quest1".

    R1 Quest1 (A) Yes/No (B) Yes (C) If yes, % of employees covered (D) 100 (E)
    R2 Quest2 (A) Yes/No (B) Yes (C) If yes, % of alignment (D) 85 (E)
    R3 Quest3 (A) Yes/No (B) Yes (C) If yes, % of employees covered (D) 10 (E)
    R4 Quest4 (A) Yes/No (B) No (C) If yes, % of alignment (D) 0 (E)


    In this case I want a number (1-100) under E if C is "Yes" and for "No" it would be zero. Above macro works fine for one row after I change cell addresses but how I can do same thing for multiple rows and in different sheets.

    Thanks.
    Last edited by saeed9313; 10-09-2008 at 11:55 AM.

  10. #10
    Registered User
    Join Date
    10-07-2008
    Location
    USA
    Posts
    30

    Solved

    Thanks, I used Roys' procedures
    Last edited by saeed9313; 10-15-2008 at 10:27 AM.

+ 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