Excel icon

Two sorting macros

When I'm doing a lot of sorting I use these two procedures to sort my used range. I've assigned them to toolbar buttons; just select the value you want to sort on and click the button to sort.

The first one sorts ascending; the second, descending.

Continue Reading: Two sorting macros »

VBA icon

Sorting arrays in parallel

parallel sort

You have two arrays:

placehorses name
3bob
2leo
4kendon
1hippo
5dad

How do you sort the "place" array so the numbers are in order, while maintaining "horse" reference integrity? In other words, how do I sort these arrays in parallel?

Continue Reading: Sorting arrays in parallel »

VBA icon

Finding values in an array without looping

If you need to find a value in an array, you might be inclined to loop through the array and using a function like Instr to match each value in the array against the selected value to see if it exists.

Until recently, I would have done the same thing (breaking it out into its own function, of course). But recently I discovered another way to do it that doesn't require looping, and thought I'd share.

Continue Reading: Finding values in an array without looping »

Outlook icon

Automatically triage emails by sender name

If you want to sort incoming emails by sender, a popular way to sort them is to move them to individual subfolders depending on the sender's name. I've written some event code based on Stock Outlook VBA Event Code that can do that for you programmatically.

Continue Reading: Automatically triage emails by sender name »

Site last updated: February 8, 2012