VBA code for MsgBox AND WorkSheet Active at same time

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

Need the VBA code to assist me with the following:

I want to use a message box to instruct the user to select a range, and be able to do
so, on the worksheet with the message box.still on top.

If I may, in addition, I would like to capture that range to a variable to be used
subsequently in the following VBA code.

Is this possible?

TIA Dennis
 
on the VBE toolbox select refedit and put it in a userform.


for more info look in Help.
 
Dennis,

You might be happier using the input box, something like...

Sub ShowMessage()
Dim myRange As Range
On Error Resume Next
Set myRange = Application.InputBox("Please select some cells", "Dennis Did It",
Type:=8)
If myRange Is Nothing Then Exit Sub
On Error GoTo 0
'Do some code
Set myRange = Nothing
End Sub


Regards,
Jim Cone
San Francisco, CA
 
Back
Top