Greetings,
I have a workbook with many sheets. II have used formulas on many of them and I have tried to copy/paste the results as text. However I may have missed some. Is there a method available to parse through each tab to see if there are any formulas remaining?
Thanks,
BRad
Determining if a tab has any formulas
-
- 4StarLounger
- Posts: 575
- Joined: 30 Mar 2010, 18:49
- Location: United States
-
- Administrator
- Posts: 79370
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Determining if a tab has any formulas
Run this macro:
Code: Select all
Sub FindFormulas()
Dim wsh As Worksheet
Dim rng As Range
Dim msg As String
On Error Resume Next
For Each wsh In Worksheets
Set rng = Nothing
Set rng = wsh.Cells.SpecialCells(xlCellTypeFormulas)
If Not rng Is Nothing Then
msg = msg & vbCrLf & wsh.Name & ": " & rng.Address
End If
Next wsh
If msg = "" Then
MsgBox "No remaining formulas!", vbInformation
Else
MsgBox "Formulas on:" & msg, vbInformation
End If
End Sub
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 575
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Determining if a tab has any formulas
Absolutely Beautiful. Worked great and found some hidden away that would have taken quite a while to locate.
Thanks!
Thanks!
-
- 5StarLounger
- Posts: 613
- Joined: 14 Nov 2012, 16:06
Re: Determining if a tab has any formulas
Unfamiliar with ?
Code: Select all
Sub M_snb()
For Each it In ThisWorkbook.Windows
it.DisplayFormulas = True
Next
End Sub
-
- 5StarLounger
- Posts: 1142
- Joined: 21 Jan 2011, 16:51
- Location: Florida
Re: Determining if a tab has any formulas
I got no output running this macro against a workbook with three sheets, one of which contained a formula.snb wrote: ↑02 Apr 2024, 19:57Unfamiliar with ?
Code: Select all
Sub M_snb() For Each it In ThisWorkbook.Windows it.DisplayFormulas = True Next End Sub
What should one expect?
PJ in (usually sunny) FL
-
- Administrator
- Posts: 79370
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Determining if a tab has any formulas
snb's macro doesn't output anything, it makes Excel display formulas in cells instead of their results.
Unfortunately, it will affect only those sheets on which you currently have a window open, not all sheets.
And you still have to inspect those sheets visually to check if they contain formulas...
Unfortunately, it will affect only those sheets on which you currently have a window open, not all sheets.
And you still have to inspect those sheets visually to check if they contain formulas...
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 613
- Joined: 14 Nov 2012, 16:06
Re: Determining if a tab has any formulas
Alternatively:
Code: Select all
Sub M_snb()
For Each it In Sheets
it.Activate
ActiveWindow.DisplayFormulas = True
Next
End Sub