Link to home
Start Free TrialLog in
Avatar of cpdata
cpdata

asked on

Find out Excel active range?

I'm trying to write an Excel macro to show percentage deviation from a certain amount.

The macro should operate only on a range of cells which the user has selected in a worksheet. I know how to find out which worksheet is active, and which single cell ("ActiveCell" reference) - but how do I find out which  _range_ of cells is selected when the user clicks the button to run the macro ?

The ideal code snippet would do the following:

     Find active range
     Perform any cell-by-cell operation on cells in that range

I was hoping that I could refer to "ActiveRange", but that doesn't exist !

I'm interested in any answer, but particularly a solution that would work on Excel 7.0 (Office 95).  Please supply me with a working example of the code if possible. I'm new to Experts Exchange, so if you think the points should be higher let me know.

thanks  a lot,

Ernesto Orega



ASKER CERTIFIED SOLUTION
Avatar of shalbe
shalbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shalbe
shalbe

If you need more help in how to apply it, let me know and I'll help you.
Avatar of cpdata

ASKER

your code does exactly what I was after - thanks a lot !

Ernesto
Glad I could help Ernesto. Thanks for the points.

Steve