Good evening,
I am trying to loop through highlighted cells, to use the script below to anchor multiple cells within formulae:
Sub ANCHOR()
Dim MyRange As Range
Dim MyCell As Range
Set MyRange = Selection
For Each MyCell In MyRange
ActiveCell.Formula = Application.ConvertFormula(ActiveCell.Formula, xlA1, xlA1, xlAbsolute, ActiveCell)
Next MyCell
End Sub
For some reason it works in the first cell selected but fails to loop through the other highlighted cells
Can anyone shed any light as to the reason?
Many thanks!
I am trying to loop through highlighted cells, to use the script below to anchor multiple cells within formulae:
Sub ANCHOR()
Dim MyRange As Range
Dim MyCell As Range
Set MyRange = Selection
For Each MyCell In MyRange
ActiveCell.Formula = Application.ConvertFormula(ActiveCell.Formula, xlA1, xlA1, xlAbsolute, ActiveCell)
Next MyCell
End Sub
For some reason it works in the first cell selected but fails to loop through the other highlighted cells
Can anyone shed any light as to the reason?
Many thanks!