View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Loop macro in selected range

But if Macro1 is in the same workbook project as standard, then you could just
call it:

Sub standard()
For Each c In selection
c.Select
Call Macro1
Next c
End Sub



Mike H wrote:

Then us

Sub standard()
For Each c In selection
c.Select
Application.Run "Macro1"
Next
End Sub

Mike

"Sjaakve" wrote:

That was fast.

That helps a lot. Only, the range is not always the same. Next time i
might want to select B12,G3,D2:F5 and run the macro for each cell.

Macro1() does not turn the cell red, it was just an example. I didn't
want to complicate things any further.

Is it possible the range is variable?

thanx

Sjaak


--

Dave Peterson