Process all cells in a (user) selection - vba

I

Isis

I am using this code to give me cell by cell access to a code defined
selection;

Dim aCell As Range
For Each aCell In Sheet4.Range("A4:A34")
' Do Stuff Here
Next aCell

which processes every cell in the A4:A34 Range

How do I do the same thing for a selection drawn by the user before
pressing my 'Process' button ?

Thanks
 
R

Ron Rosenfeld

I am using this code to give me cell by cell access to a code defined
selection;

Dim aCell As Range
For Each aCell In Sheet4.Range("A4:A34")
' Do Stuff Here
Next aCell

which processes every cell in the A4:A34 Range

How do I do the same thing for a selection drawn by the user before
pressing my 'Process' button ?

Thanks


Dim aCell As Range
For Each aCell In Selection
' Do Stuff Here
Next aCell
--ron
 

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

Top