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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top