View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave
 
Posts: n/a
Default Replace using Wildcards

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

"Stella" wrote in message
...
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