Replace using Wildcards

  • Thread starter Thread starter Stella
  • Start date Start date
S

Stella

How do use wildcards using the Find/Replace menu.

According to help it's possible to use '?' & '*' but it never seems to work
for me.


Let's say I have a block of cells that contain references to other cells
something like =if(a5...); =if(b3...); =if(c2...) etc. I wish to make all
the row numbers absolute - i.e. =if(a$5...); =if(b$3....); =if(c$2...) and
so on.

TIA
Stella
 
Stella

Gord Dibben posted the following code earlier this month. It works great.

Try these. Ignores cells without formulas.

Dave

Sub Absolute()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsolute)
End If
Next
End Sub


Sub AbsoluteRow()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsRowRelColumn)
End If
Next
End Sub


Sub AbsoluteCol()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelRowAbsColumn)
End If
Next
End Sub


Sub Relative()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelative)
End If
Next
End Sub
 
Back
Top