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 [...]
Posted: Friday, March 14th, 2008 under VBA.
Comments: 1
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, [...]
Posted: Thursday, March 13th, 2008 under VBA.
Comments: none
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, [...]
Posted: Wednesday, March 12th, 2008 under VBA.
Comments: 4
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 [...]
Posted: Tuesday, March 11th, 2008 under VBA.
Comments: none
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 [...]
Posted: Monday, March 10th, 2008 under VBA.
Comments: 2
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 [...]
Posted: Sunday, March 9th, 2008 under VBA.
Comments: 8
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 [...]
Posted: Friday, March 7th, 2008 under VBA.
Comments: 7
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 [...]
Posted: Thursday, March 6th, 2008 under VBA.
Comments: 1
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 [...]
Posted: Monday, March 3rd, 2008 under VBA.
Comments: 34
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 [...]
Posted: Monday, March 3rd, 2008 under VBA.
Comments: none

