Few things in life are constant. Heraclitus said: The only thing constant is change. Change is constant and variables are used to capture change. In the context of Excel, the names of workbooks change, the number of workbooks you have open is variable, the number of sheets, pivot tables and charts is usually variable, the name of sheets is variable, the values in cells are variable, and on, and on.
Continue readingExcel Class NYC Custom Table Styles Free Tutorial
Excel Classes in NYC offers a free Excel tutorial on how to create a custom table style. To learn Excel in NYC, call us at 212.828.7089 to discuss your Excel training objectives.
Continue readingExcel Class VBA Macro Adds IfError Functions To Every Formula
Excel Class VBA Macro Adds IfError Functions To Every Formula
Today a student asked Excel Class if there was a macro to automatically add an IfError function to every formula on every sheet in a selected workbook, assuming there was not already an IfError function used.
On short notice the Excel Class instructor provided the following code which we wanted to share with our readers.
Remember that macros have no Undo command. Once you run this VBA macro the only undo is to close the file without saving changes. The macro leaves a selected workbook open so you can review the changes before deciding to save or not.
To use this code, press the Alt+F11 key to open the VB Editor.
Select the Insert menu > Module command.
Then paste the following code into the empty window:
To run the program, press the F5 key, or from Excel select the Ribbon View Tab > Macros button and run the AddIfError macro.
Public Sub AddIffError()
‘purpose: IF there is a formula add iferror
‘if there’s an iferror already, ignore the formula
‘process all sheets in wb
‘Handle Errors
On Error GoTo Errorhandler
‘Step 10: Ask user to open a wb
MsgBox “Please click OK to select a workbook to process”
‘Step20: Prompt user to open wb to process
With Application.FileDialog(msoFileDialogOpen)
.Show
.Execute
End With
‘Step30: On every sheet add iferror
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
If ws.Visible = True Then ws.Select
‘Select all cells
Range(“A1”).Select
ActiveCell.CurrentRegion.Select
Dim r As Range
For Each r In Selection
If Left(r.Formula, 1) = “=” Then
If Left(r.Formula, 8) = “=IFERROR” Then
‘Do Nothing
Else
Dim myformula
myformula = Right(r.Formula, Len(r.Formula) – 1)
r = “=IfError(” & myformula & “,0)”
End If
End If
Next r
Next ws
Exit Sub
Errorhandler:
If Err.Number <> 0 Then
MsgBox “Something went wrong”
End If
End Sub
If you want to learn more about Excel VBA programming check out our 2-day Excel VBA course in New York City.
Excel Class Announces New Blog
Excel Class New Excel Blog
Continue readingExcel Class Training NYC Announces Spring Excel Calendar
Excel Class Training NYC Announces Spring Excel Calendar for Introduction To Excel class dates, Intermediate – Advanced Excel class dates, and Excel VBA class dates
Continue readingExcel Class NYC – Free Excel Training Tutorial – Excel Text Functions
Excel Class nyc offers a free excel training blog tutorial post. This Excel Class Blog is part I of a three part series of Excel training about text functions.
Continue readingExcel VBA Class Announces East Coast Schedule For Q1 2011
Excel Class is pleased to announce our Q1 2011 Excel VBA Classes schedule.
Philadelphia, PA
February 16th – 18th – Register Here
Boston, MA
February 23rd – 25th – Register Here
Baltimore, MD
March 1st – 3rd – Register Here
Miami, FL
March 7th – 9th – Register Here
Atlanta, GA
March 16th – 18th – Register Here
Tampa, FL
March 28th – 30th – Register Here
Excel Class Blog – Free Excel Tutorial – Excel Relative versus Absolute References
Excel Class Free Tutorial – Learn about Excel Relative and Absolute References
Continue readingExcel Class NYC Blog – Learn Excel VBA To Navigate
VBA Class Blog – Learn Excel VBA To Navigate Cells and Sheets
Continue readingExcel Class Training NYC Blog – Learn To Use 3-Dimensional Formulas To Consolidate Data
Excel Class NYC Training Blog offers free Microsoft Excel Tutorial on 3-Dimensional Functions. Download the practice test to see if you can master data consolidation with Microsoft Excel.
Continue reading