Select Activecell in Range

G

Guest

Hi Everybody
I have code that references to the ActiveCell and I would like to use this
code looping through a range selection. If I code as follows

For Each cell in Selection
‘MyCode in here
Next cell
This does not change the ActiveCell

How can I loop through a range selection making each cell become the
Activecell

Example
Range("A3,A6,A9").Select
For Each cell In Selection

' Make cell ActiveCell
' Code that references to the Activecell

Next cell

Many Thanks in advance.
 
B

Bob Phillips

It is highly unlikely that you need to activate each cell, it is slow, and a
drag on your app.

For Each cell In Range("A3,A6,A9").
Msgbox cell.address
Next cell

as an example. Use the cell object to work upon the cell without moving.
 

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