input message boxes

  • Thread starter Thread starter Dominique Feteau
  • Start date Start date
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
 
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
 
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
 
Back
Top