Doing search in worksheet

  • Thread starter Thread starter lostinexcel
  • Start date Start date
L

lostinexcel

I need to search all worksheets to see if any cell has a formula in it? Any
help is appreciated.
 
lostinexcel said:
I need to search all worksheets to see if any cell has a formula in it? Any
help is appreciated. I also need to take the information found, place it in a new worksheet, name the worksheet in column A, put the formula in column B, and the formula result in column C.
 
Try this in a standard module:
Sub find_formula()
Dim sh As Worksheet, cel As Range
For Each sh In Sheets
For Each cel In sh.UsedRange
If cel.HasFormula Then
MsgBox cel.Address
End If
Next cel
Next sh
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