Archive for 'VBA'
Unspecified but Painfully Frustrating Error
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
In recent months I have encountered a particularly troublesome error. It occurs in Excel 2003 and 2007 (and perhaps in earlier versions, but I don’t recall any such cases). The error is heralded by an unusually unhelpful error message, even my Microsoft’s standards: Microsoft Visual Basic - System Error &H80004005 (-2147467259). Unspecified error.
Posted: Tuesday, June 23rd, 2009 under VBA.
Comments: 9
Stack Columns In Order Of Size With VBA
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
In Stack Columns In Order Of Size I showed a worksheet formula approach to sort columns in each stack in a stacked chart by size, not by series. When you create a stacked column chart the usual way, the columns are stacked in the same series order, as shown below.
- - -
This technique [...]
Posted: Tuesday, May 19th, 2009 under VBA.
Comments: none
Extend Range to Add New Series (VBA)
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
In some of the analyses I do, I’ll have a range of data and some charts based on this range. As the analysis unfolds, more columns may be added to the data range, and these have to be added to the chart. Until last week, I would add a series by copying the series formula [...]
Posted: Monday, May 11th, 2009 under VBA.
Comments: 2
Interactive Charts with Checkboxes and VBA
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
By definition an interactive dashboard contains methods for users to control which information is displayed. This can be accomplished in many ways. In Interactive Charting by Combo Box or Checkbox I wrote about using checkboxes and worksheet formulas to do this, and I elaborated on the technique in Interactive Charts with Checkboxes and Formulas.
There are a [...]
Posted: Wednesday, April 1st, 2009 under VBA.
Comments: 1
Make Your Recorded Macro Independent of Which Sheet is Active
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
When you run a recorded macro, it may work great, except it keeps referring back to the original worksheet. It also refers back to the original data range. Both of these situations can be remedied by editing of the recorded macro.
In How To: Fix a Recorded Macro I showed how to make a recorded macro [...]
Posted: Monday, March 16th, 2009 under VBA.
Comments: none
Validation Functions
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
Today in Daily Dose of Excel, Dick wrote about Code Construction. One of his topics was to pull pieces of a routine out into a separate procedure, particularly if that piece of a routine included fiddling with On Error Resume Next and On Error Goto 0.
Dick’s example was to replace this section of code:
Posted: Thursday, March 12th, 2009 under VBA.
Comments: 12
VBA to Filter Chart Data Range
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
In the comments of Choice of Category Axis Order a reader asked how to use only part of a range as the source data for a chart. Her data and chart initially looked like this:
The line “Total Other Items” is a sum of the items below it in the list, and the chart does not show [...]
Posted: Friday, December 5th, 2008 under VBA.
Comments: 8
Count Bold Cells in a Range
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
I was asked if there is any way to count all of the bold cells in a range. Of course there is. Here is a simple VBA function that carries out this task:
Function CountBoldCellsInRange(rng As Range) As Long
Dim rCell As Range
Dim iBold As Long
iBold = 0
For Each [...]
Posted: Thursday, October 16th, 2008 under VBA.
Comments: 10
Label Each Series in a Chart
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
In 9 Steps to Simpler Chart Formatting I suggested using data labels to identify each series rather than using a legend. I have a small VBA procedure that I use for this. It labels the last point of each series, and removes other labels. It also has an error trap that skips points that are [...]
Posted: Wednesday, October 15th, 2008 under VBA.
Comments: 13
Extract Chart Data
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
This post presents a VBA procedure that extracts all data from a chart, and places it into a new worksheet. Why would you want to extract a chart’s data? Sometimes a chart gets its data from diverse sources, and you’d like to have the data in one place. You may receive a workbook that contains [...]
Posted: Tuesday, August 26th, 2008 under VBA.
Comments: 8










