Having a Macro Prompt Me For Input

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have this macro:

Sub temp()

Range("B19").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveWorkbook.Names.Add Name:="NameOfWorksheetHere", RefersToR1C1:= _
"='throttling 01102005'!R19C2:R115C6"
End Sub

Is it possible to have the macro prompt me to enter the name for
"NameOfWorksheetHere" ?

Thank you in advance.
Was this post helpful to you?
 
Thank you. I modd'ed my macro to this.

Now I would like this marco to run on each selected worksheet. I selcted my
worksheets but the macro stalled on the last line.

How can I have this macro repeat for each selected worksheet ?

Thank you again.
 
I'm still not sure of exactly what you want. A complete explanation might be
helpful.

You do not need to make selections to most things.

Range("B19").End(xlDown).End(xlToRight).select

Why are you selecting the cell when you are naming another cell?
I assume that the worksheet is a different worksheet.

Sub AddNamewithinputbox()
wsname = InputBox("Enter Worksheet Name")
Names.Add Name:="don", RefersTo:="=" & wsname & "!b2"
End Sub
 

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

Back
Top