View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Operate on each cell in range.

actually, on 2nd thought, you should probably change this:
call Adjust_Formula

to this:
c.Formula = "=" & c.Value * 2 & "*(QTR/4)"

susan


On Jun 1, 1:34*pm, Susan wrote:
Sub do_all()

dim MyRange as range
dim c as range

'adjust myrange to suit
set MyRange = worksheet.range("a1:b15")

for each c in MyRange
* * * call Adjust_Formula
next c

End Sub

that should do it!
(somebody else will probably have a simpler way of doing it,
but..........)
:)
susan

On Jun 1, 1:11*pm, Fred Holmes wrote:



How do I put wrapper code around the below, so that I can select a
range of "many" cells and have the code execute on each cell in turn?


For each cell in selected range (selection) . . .


Sub Adjust_Formula()
* * ActiveCell.Formula = "=" & ActiveCell.Value * 2 & "*(QTR/4)"
End Sub


The formula works fine on a single cell.


Many thanks,


Fred Holmes- Hide quoted text -


- Show quoted text -