ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Replace using Wildcards (https://www.excelbanter.com/excel-worksheet-functions/95757-replace-using-wildcards.html)

Stella

Replace using Wildcards
 
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



Dave

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






All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com