Triggering macro

P

Patrick C. Simonds

I am looking for a one time use macro which will select and then deselect
each cell in the range G7:p300. I need this to trigger a worksheet change
macro in each of the cells. I can do this manually by selecting the cell
then clicking in the formula bar then selecting the next cell. But that is
close to 3000 cells and would be very time consuming.
 
S

SteveM

I am looking for a one time use macro which will select and then deselect
each cell in the range G7:p300. I need this to trigger a worksheet change
macro in each of the cells. I can do this manually by selecting the cell
then clicking in the formula bar then selecting the next cell. But that is
close to 3000 cells and would be very time consuming.

You want to loop through the range of cells using the For Each Next
Construct. Like this:

Sub ChangeCells()
Dim cRange as Range, cell as Range

Set cRange = Range("G7:p300")

For Each cell in cRange
cell change code here
Next

End Sub

That's it.

SteveM
 

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