how do i create a pop up box to prompt the user for info?

G

Guest

I had created a program a few years ago in Excel, but can't remember how to
do it now. I had a button assigned to a macro, and when the user clicked the
button, a series of pop up boxes prompted the user for information. That
information was then used in the spreadsheet. Now I can't even remember how
to make the pop up boxes. Can anyone help please?
 
L

Lee S

Karyn,

An easy way to create a simple prompt is with the InputBox() function. Put
this into your button macro:

Cells(1,1) = InputBox("Type in something", "My Title")

See help for InputBox() for more options available for the function.

If you want fancier input boxes, you would create User Forms in the Visual
Basic Editor, which gets a bit more complex.

Lee
 
G

Guest

OK, that worked for the pop up box, thank you. But now, it's not putting the
input into that cell....
This wasn't the way I did it before, because I don't know much about
programming, but I do know some. But I'm up for doing it this way if I can
figure out how to work it, I'm stumped.
 
L

Lee

Karyn,

So, you say you get the prompt and you can type in a value, but the value
doesn't go into the cell?

Can you paste the macro code that runs when you click the button?

Lee
 
G

Guest

OK, I figured all that out. Now I have a different problem.... I have a
table set up. The dates are all in column A, then in columns F and G, there
are number values. How do I get the sum of the number values for exact dates.

Example: If date = 3/5/05, then add #

Thank you for all your help Lee :)
 
L

Lee

Not sure what you are asking, but it sounds like you need the IF function:

=IF(A1="3/5/2005", A1+F1, A1+G1)

When A1 is 3/5/05, then
compute A1+F1
otherwise
compute A1+G1

If the computation returns a number, then format the cell as a date.

Lee
 
L

Lee

Karyn,

I just noticed a mistake in my expression. Should be:

=IF(A1=DateValue("3/5/2005"), A1+F1, A1+G1)

Lee
 
T

Tom Ogilvy

=sumif(A:A,"3/5/05",F:F)

or for both columns

=SUMIF(A:A,"3/5/05",F:F)+SUMIF(A:A,"3/5/05",G:G)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top