PTS Blog

Main menu:

PTS Utilities

Commercial Utilities developed by Peltier Technical Services

  Waterfall Chart
  Box and Whiskers
     Coming soon!


 

Excel Books

Books that I own and use while developing in Excel

Goods and Services

Excel or charting related products and services which I use or feel are worthwhile additions

Subscribe

Subscribe

Site search


Recent Posts

Recently Commented

Popular Posts

Archive


 

Categories


 

Archive for 'VBA'

How To: Assign a Macro to a Toolbar or Menu

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

In the last couple of posts, I've discussed assigning macros to Forms toolbar controls and shapes, and to ActiveX controls from the Control Toolbox. Macros can also be run from a toolbar or menu.
This technique is valid for Excel 97 through 2003. The new user interface in Excel 2007 has no toolbars or menus, but [...]

How To: Assign a Macro to an ActiveX Control

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

In the latest post, I showed how to assign a macro to a Forms menu control or other shape on a sheet. Macros can also be run from the ActiveX controls on the Control Toolbox.
We'll use this simple macro for this example.
PLAIN TEXT
Visual Basic:

Sub HelloWorld()

    MsgBox "Hello, World! ", vbExclamation

End Sub

When it is run, [...]

How To: Assign a Macro to a Button or Shape

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

In recent posts, I've discussed recording macros, fixing recorded macros, and even using someone else's macros. To run a macro, you have a few choices.

Tools menu > Macro > Macros, select the Macro, and click Run
Shortcut Key combo Alt+F8, select the Macro, and click Run
Run Macro button on the Visual Basic toolbar, select the Macro, [...]

How To: Fix a Recorded Macro

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

In a recent post, I showed how to record a macro to save yourself time and effort with that repetitive task. The recorder has captured all of your keystrokes, intentional and otherwise. Objects are selected first, then acted upon. Defaults are applied indiscriminately every time the recorder followed you into a dialog. Actions you take and undo [...]

How To: Record Your Own Macro

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

In a recent post, I showed how to copy someone else's VBA procedure (i.e., "macro") and paste it into your own workbook. Fortunately you don't have to rely on others for custom macros. Excel includes a Macro Recorder which captures your actions, so that you can replay them later, saving yourself time and keystrokes.
It's easy [...]

How To: Use Someone Else’s Macro

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

This is the first in a series of How To posts that are targeted at Excel users who are unfamiliar with VBA programming. Topics will include
Using someone else's macro
Recording your own macro
Fixing a recorded macro
Assigning a macro to a button or shape, ActiveX button, or menu or toolbar
VBE settings
VBE features
Debugging and error proofing
Suppose you [...]

UDF to Calculate an Arbitrary Formula

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

Last night a colleague complained because there was no way to evaluate a formula in the worksheet. What he meant was, he wanted to enter "m X + b" (for example, with numerical entries in place of m and b) into a cell, then link to another cell that contained a value of X, and [...]

Quick VBA Routine: XY Chart with Axis Titles

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

Someone asked in the newsgroup how to create an XY chart in Excel that uses the label at the top of the columns of X and Y data for the axis titles. That's not built in, but it's not hard to do if you know a little VBA. I've taken an example from my web [...]

VBA Conditional Formatting of Charts by Series Name

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

I've got a couple of tutorial pages on my web site that deal with conditionally formatted charts. The trick is to set up ranges containing formulas for each of the conditions, so that if the condition for that range is met, the range contains the value to plot, otherwise it contains #N/A, which isn't plotted [...]

VBA Conditional Formatting of Charts by Value

by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.

I've got a couple of tutorial pages on my web site that deal with conditionally formatted charts. The trick is to set up ranges containing formulas for each of the conditions, so that if the condition for that range is met, the range contains the value to plot, otherwise it contains #N/A, which isn't plotted [...]

Create Excel dashboards quickly with Plug-N-Play reports.