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

dim cell as range
for each cell in selection.cells
cell.Formula = "=" & Cell.Value * 2 & "*(QTR/4)"

next


"Fred Holmes" wrote in message
...
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