DanielDaly
New Member
- Joined
- Aug 1, 2016
- Messages
- 6
Hi Everybody,
Its killing me that I cannot find on the internet how to make a simple VBA coded macro apply to all or select sheets in a workbook. The following code works and I just want to be able to apply it to all or select worksheets:
Any suggestions or solutions would be really appreciated. Thank you.
Best regards,
Daniel Daly
Its killing me that I cannot find on the internet how to make a simple VBA coded macro apply to all or select sheets in a workbook. The following code works and I just want to be able to apply it to all or select worksheets:
Code:
Sub Add_IFERROR_Activesheet()
Dim myCell As Range
Application.ScreenUpdating = False
Cells.SpecialCells(xlCellTypeFormulas, 23).Select
For Each myCell In Selection.Cells
If myCell.HasFormula And Not myCell.HasArray Then
myCell.Formula = "=IFERROR(" & Right(myCell.Formula, Len(myCell.Formula) - 1) & ",0)"
End If
Next
Application.ScreenUpdating = True
End Sub
Any suggestions or solutions would be really appreciated. Thank you.
Best regards,
Daniel Daly