ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hook into worksheet events temporarily? (https://www.excelbanter.com/excel-programming/348187-hook-into-worksheet-events-temporarily.html)

Alex Popescu

hook into worksheet events temporarily?
 
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



Philip

hook into worksheet events temporarily?
 
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

"Alex Popescu" wrote:

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





All times are GMT +1. The time now is 12:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com