Today I found some useful code I wanted to share with our readers. 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. Remember that macros have no Undo command. Once you run this VBA macro the only undo is to close […]
Articles Tagged: VBA Macros
VBA Macros for Conditional Formatting
VBA Macro for Conditional Formatting Private Sub Worksheet_Change (ByVal Target As Range) Set MyPlage = Range(“C3:I11,C13:I34”) For Each Cell in MyPlage If Cell.Value Like “A*” Then Cell.Interior.ColorIndex = 38 ElseIf Cell.Value Like “B*” Then Cell.Interior.ColorIndex = 35 ElseIf Cell.Value Like “C*” Then Cell.Interior.ColorIndex = 34 ElseIf Cell.Value Like “D*” Then Cell.Interior.ColorIndex = 40 Else Cell.Interior.ColorIndex […]
Learn to Plot A “XYScatter Chart” on Fly : VBA Macro Code
VBA Macro Code to Plot A “XYScatter Chart” on Fly Sub chartData() On Error Goto ErrHandler Dim xRow As Long Dim wsName As String Dim ws As Worksheet Set ws = ActiveSheet wsName = ws.Name xRow = Cells(Rows.Count, “A”).End(xlUp).Row ActiveSheet.Shapes.AddChart.Select ActiveChart.ChartType = xlXYScatterSmooth ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(1).Name = “='” & wsName & “‘!$A$17” ActiveChart.SeriesCollection(1).XValues = “='” & […]
How to calculate Average Excluding Outlayers from the Calculation – VBA Macros
Question: In Microsoft Excel, how can you average a column of numbers, excluding one or more cells that are outlyers that shouldn’t be averaged? For example, if I wanted to average the following numbers, but exclude 4527 from the average calculation because it is a value that is less than 5000. 4024, 10554, 9295, 11343, 8056, […]
How to convert Numbers to Words in Indian Currency Format – VBA Macros
How to convert Numbers to Words in Indian Currency Format There are almost 200+ similar requests from our page followers to how to convert numbers to words, below given code will suit to all the queries at the best. Hope this helps. How to create the function Called SpellNumber() 1) Start Microsoft Excel. 2) Press […]
Learn to Compose and send emails from Excel using VBA
Isn’t it good if we can send emails directly from Excel? Check here to know how to send emails from Excel using VBA.