View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
jlclyde jlclyde is offline
external usenet poster
 
Posts: 410
Default Change Formulas W/VBA

I have put in code to copy formulas to all the correct cells, now I
need to go in and replace all of the ones with what the row number
is. The below code does nto work. Active cell never happens so it
bugs out.

Thanks,
Jay

LstRow = Sht.Range("A65536").End(xlUp).Row
Set Rng = Sht.Range("F3:F" & LstRow)
Sht.Range("F" & LstRow) = Sht.Range("F1").Formula

For Each i In Rng
i = Sht.Range("f1").Formula
ActiveCell.Replace What:="1", Replacement:=i.Row, LookAt:=xlPart,
_
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False
i = i.Value
Next i