hook into worksheet events temporarily?

  • Thread starter Thread starter Alex Popescu
  • Start date Start date
A

Alex Popescu

Hi everybody

I would like to write a wizard function similar to excel ones where once the
function is started, I can pick up a range by switching to the worksheet and
get the user selected range.

My problem is how do I hook up into the worksheet events (ie
SelectionChange) only while the function is running? If the technical aspect
of this is too complicated, would anybody know of a good Microsoft or web
article?

The way I am planning to go about it is to create a user form with all the
processing in the background and somehow hook into the worksheet events.

Any help would be very much appreciated!!!

Many thanks
alex
 
You can use the inputbox function with option 8 like this:

Dim rngSelection As Range
Set rngSelection = Application.InputBox( _
Prompt:="Please select a range.", _
Type:=8)

this puts a range as the
HTH

Philip
 

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