nagovind
Member
Below code is working well to revolve arround the Relative and Absolute References
However the issue is it is converting all formulas in a sheet
Is it possible to run a code ONLY ON THE SELECTED cell ?
Please advise
[pre]
[/pre]
However the issue is it is converting all formulas in a sheet
Is it possible to run a code ONLY ON THE SELECTED cell ?
Please advise
[pre]
Code:
Sub CycleAbsRel()
Dim inRange As Range, oneCell As Range
Static absRelMode As Long
absRelMode = (absRelMode Mod 4) + 1
Set inRange = Selection.SpecialCells(xlCellTypeFormulas)
If Not (inRange Is Nothing) Then
For Each oneCell In inRange
With oneCell
.FormulaR1C1 = Application.ConvertFormula(.FormulaR1C1, xlR1C1, xlR1C1, absRelMode, oneCell)
End With
Next oneCell
End If
End Sub