+ Reply to Thread
Results 1 to 12 of 12

Add a dialogue box

  1. #1
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Add a dialogue box

    If a cell has a value in it, I would like have a box come up and ask for a value (number). There are a possibility of 15 cells. And I want a different cell to add up all the times that I put in the dialog box.

    Thanks in advance!

  2. #2
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add a dialogue box

    Like if any of the cells between F5:F20 have an "x" then it'll ask how much time. And it'll keep track of all the times entered and add them up in A5.

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

    Re: Add a dialogue box

    First put =SUM(F5:F20) in A5


    Then this Sub could be run to get your values.

    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.

  4. #4
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add a dialogue box

    I did that in the Visual Basic editor... and nothing happens when I put an "x" in those columns...

  5. #5
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add a dialogue box

    Here is a screenshot. Thanks for your help.

    Screen Shot 2017-01-16 at 4.22.00 AM.png

  6. #6
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add a dialogue box

    Perhaps there is a different way to do this? B4 needs to be added up automatically, all the times that are entered in the "Enter Credit" if there is an "x" in the I column.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,473

    Re: Add a dialogue box

    Did you add a CommandButton attached to the macro "Sub Test() so when clicked it will fire the macro ?

  8. #8
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add a dialogue box

    Negative ... I haven't done VB since high school bak in the late 90's ... I don't remember much haha. But is there a different way to do this besides VB and having to add in extra steps? Thank you.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,473

    Re: Add a dialogue box

    You could place the macro in the Sheet Change event.

    Both of these look the same but they are not. Closely look at the Sub name at the top of each. This goes in the VBE editor window for the affected worksheet.
    In your pic you have Sheet3(Feb) highlighted. If you click on that, as you did to insert the first version of the macro, delete the existing macro, then paste
    one of these in its place.

    You only need to paste one of the macros. I would start with the second one.


    # 1

    Please Login or Register  to view this content.

    # 2

    Please Login or Register  to view this content.

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,473

    Re: Add a dialogue box

    I've tried the two new macros. Neither one works satisfactorily.

    Try this :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add a dialogue box

    I will check it when I get to my computer. Thank you.

    But the value of the cells should still be "x", but the sum of B5 should be all the values that were entered into the "Enter Credit" msgBox ... make sense?

    Thanks again!

  12. #12
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,473

    Re: Add a dialogue box

    .
    Add this formula to the Formula Bar for cell B5:
    Please Login or Register  to view this content.
    Change the macro code to this:

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Dialogue Box VBA
    By KG23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-15-2014, 01:27 PM
  2. Pop up dialogue box
    By TG77 in forum Excel General
    Replies: 1
    Last Post: 06-28-2010, 11:15 AM
  3. Dialogue Box?
    By sgilleland in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2007, 04:39 AM
  4. [SOLVED] dialogue pop up
    By Micayla Bergen in forum Excel General
    Replies: 5
    Last Post: 06-23-2006, 05:50 PM
  5. pop up dialogue box
    By Micayla Bergen in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-22-2006, 09:40 PM
  6. pop up dialogue
    By Micayla Bergen in forum Excel General
    Replies: 0
    Last Post: 06-22-2006, 09:25 PM
  7. [SOLVED] SaveAs Dialogue Box
    By Tony D in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2006, 05:40 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