prompt for input while macro running

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

Guest

Using Excel 2000. I am trying to create a macro to cut information from an open worksheet and insert that information into another worksheet within the same workbook. I can't figure out how to get the macro to prompt me for which worksheet I want to insert the information into.
 
Hi,

Try to use an inputbox :

strWorksheet = InputBox("Please enter the name of the worksheet t
paste :"
 
You can use Inputbox to get information from the user.

If you use Application.Inputbox (this is different) with a Type value of 8,
the user input can be a range, so you could ask them to activate the
workbook and worksheet to insert into.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

mmcintire said:
Using Excel 2000. I am trying to create a macro to cut information from
an open worksheet and insert that information into another worksheet within
the same workbook. I can't figure out how to get the macro to prompt me for
which worksheet I want to insert the information into.
 
See if this works:

Sub Test()
Dim R As Range
Dim Msg As String
Msg = "Yo da man"
On Error Resume Next
Set R = Application.InputBox( _
"Click where you want the message:", _
Type:=8)
If R Is Nothing Then Exit Sub
R.Value = Msg
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

mmcintire said:
Using Excel 2000. I am trying to create a macro to cut information from
an open worksheet and insert that information into another worksheet within
the same workbook. I can't figure out how to get the macro to prompt me for
which worksheet I want to insert the information into.
 
Back
Top