ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   searching for a specific part of a formula (https://www.excelbanter.com/excel-programming/376273-searching-specific-part-formula.html)

Gert

searching for a specific part of a formula
 
I try to find in a worksheet all formulas which contains the carracters
"hfm" or "HFM".
The second step is to replace all this formulas by their values.

Does anyone know how to search for a small part of a formula ???

thanks in advance


Mark VII

searching for a specific part of a formula
 
After clicking on Edit, then Find, click on the Options button on the Find
dialog. That exposes more functionality. You can selete whether to search
just the worksheet or the whole book. The bottom left dropdown, "Look In"
lets you select whether to search values for formulas. Be sure the "match
entire cell contents" check box is not selected.

HTH,
Mark VII

"Gert" wrote:

I try to find in a worksheet all formulas which contains the carracters
"hfm" or "HFM".
The second step is to replace all this formulas by their values.

Does anyone know how to search for a small part of a formula ???

thanks in advance



Gary''s Student

searching for a specific part of a formula
 
Sub hfm_killer()
Dim r As Range, s As String
For Each r In ActiveSheet.UsedRange
If r.HasFormula Then
s = r.Formula
If InStr(UCase(s), "HFM") Then
r.Value = r.Value
End If
End If
Next
End Sub
--
Gary's Student


"Gert" wrote:

I try to find in a worksheet all formulas which contains the carracters
"hfm" or "HFM".
The second step is to replace all this formulas by their values.

Does anyone know how to search for a small part of a formula ???

thanks in advance




All times are GMT +1. The time now is 04:48 AM.

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