input message boxes

D

Dominique Feteau

I have a macro with references that will change month to month. I want to
setup an input box that will ask the user which reference (defined name) to
use and will insert it into the macro and have it continue from there.

What the macro does is copies a number of columns and pastes them into
another workbook including a column for the amount for the month. so the
line for february look like this:

Application.Goto Reference:="Submitted,Feb"

In the end, what I want to happen is for a message box to appear asking
"What month?" or what defined name (which are already set up for all months)
and the user would type in "Mar" and the line would change to:

Application.Goto Reference:="Submitted,Mar"

or however else it would do it.


Any suggestions?
Niq
 
G

Gord Dibben

Dominique

Public Sub gronk()
whamnth = InputBox("enter a month")
Application.Goto Reference:="Submitted_" & whamnth
End Sub

Note the "Submitted_"

I can't get Excel to accept a comma in a defined name. If you can. please let
me know how.

Gord Dibben Excel MVP
 
D

Dominique Feteau

Gord

Thanks for your help. It worked like a charm when I used the line:

Application.Goto Reference:="Submitted," & whamnth

I'm guessing it saw the comma as part of a text string.

Thanx again
Dominique
 

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