Fun with Custom Lists

February 8, 2010 2 comments »

I was fiddling around with Custom Lists the other day, when I noticed that Microsoft prevents me from deleting any of their built-in Custom Lists.

Don't believe me? Just pull up the Custom Lists dialog box and try to delete that lame Sun – Sat list. You can't do it. The Delete button is disabled like this:

 

Why? I've done real-world work in Excel for over 15 years, and I have never needed Sun-Sat. Even if I did need it, why prevent me from deleting the default lists?

Out of spite, I decided I was going to find a way to delete that dumb-ass list.

 

So I turned to VBA. First, I tried the DeleteCustomList method. It turns out, you need to know the index number of the Custom List you're deleting.

 

After a little research, I found out the only way to get the index number of a Custom List, is to literally pass the entire list to the GetCustomListNum method.

Here, you can see that you have to pass the list in an Array.

 

The list you pass has to be EXACT. If you goof, you get an index number of 0.

This seems a little clunky to say the least. What if my list is 50 strings long?

Now, I have to admit, I can't think of a better way to get the index number. But it still seems weird to pass the entire list.

 

In any case, this is the code I tried next.  

Sub Delete_Any_List_I_Damn_Well_Please()
Dim i As Integer
i = Application.GetCustomListNum(Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"))
Application.DeleteCustomList (i)
End Sub

Guess what - it failed.  Apparently, you can't delete the default lists via VBA either.  There must be something that tells Excel not to touch the first 4 lists.  Bastards!  You win this time Microsoft, but I'll be back.

 

On a positive note, you can Add a Custom List using VBA.

Now, this may seem fairly useless, but I can imagine this coming in handy when you want to share your Custom Lists with your co-workers. For example, imagine you work at McDonalds and you want to share your list with 20 people who all have lame Excel skills.

Simply have them run this code, and Excel will automatically add a new Custom List.

Sub Add_Big_Mac()
Dim i As Integer
'Check if the list exists.
    i = Application.GetCustomListNum(Array("Two All Beef Patties", "Special Sauce", "Lettuce", "Cheese", "Pickles", "Onions", "Sesame Seed Bun"))

'Exit if the list is already there.
    If i> 0 Then
        Exit Sub
    Else
'Add the list if it does not exist.
        Application.AddCustomList (Array("Two All Beef Patties", "Special Sauce", "Lettuce", "Cheese", "Pickles", "Onions", "Sesame Seed Bun"))
    End If
End Sub

Bacon-wrapped Grilled Kielbasa

February 7, 2010 2 comments »

On this blog, Saturday is Bacon recipe day. So no Excel tips and tricks today. Today we learn about bacon.

 

Take a look at this shiny recipe for Bacon-wrapped Grilled Kielbasa. I like to sneak these into the movies, and pull them out when the lights go dim. I sit back and watch everyone wonder from where that lovely smell is emanating.

  • 1 lb high-quality Kielbasa
  • 1/2 lb thick-cut bacon
  • 1/4 cup maple syrup
  • 3 tbsp mustard
  • Chili powder
  • Fire

 

Cut the kielbasa into one-to-two-inch chunks.

Simmer in some water for a few minutes.

Remove from the water and wrap each one with half a slice of bacon.

Impale with moistened bamboo skewers and commence grilling.

Combine maple syrup, mustard, and chili powder in a bowl.

Once the bacon is crisp, brush the meat on all sides with the glaze and grill for a few additional minutes.

Excel Zoom Box Font Size Follow Up

February 4, 2010 1 comment »

I recently posted about creating a Zoom Box in Excel . Alan writes in the comments:

"One of the features in Access that I really like is the ability to set a font size. Older people are sometime vision impaired, but you will learn about that in time. Is it possible to increase the font in the zoom box or set a font option?"

Anything for one of my 12 fans Alan. The steps are outlined below.

» Read more: Excel Zoom Box Font Size Follow Up

Avoiding Data Cut-Off in Excel

February 3, 2010 6 comments »

It's been a busy week and I've been working hard. I think I'll reward myself by writing a blog post for people I've never met. Here we go.

Let's talk about getting Access Memo Fields into Excel.

  » Read more: Avoiding Data Cut-Off in Excel

Egg and Bacon Pie

January 31, 2010 2 comments »

On this blog, Saturday is Bacon recipe day. So no Excel tips and tricks today. Today we learn about bacon.

 

Last week, Jeff Weir hinted at an "Aussie" recipe. Doing a little research, I found a site called KeeWeesCorner.

Apparently, Bacon and Egg Pie is traditional Aussie tucker.

Judging from the picture, it's mighty tasty looking. Although, too many pieces will probably cause problems Down Under.

  » Read more: Egg and Bacon Pie

Paste Special Skip Blanks

January 28, 2010 3 comments »

Today, I want to show you how to use the Skip Blanks option in the Paste Special dialog box. You've all probably seen it there, but you've never used it.

Here it is in the expertly placed square box.

» Read more: Paste Special Skip Blanks

Clearing Access ImportError Tables

January 26, 2010 2 comments »

If you move data from Excel to Access on a regular basis, you'll know that sometimes Access can't resolve the data being imported from Excel. In these cases Access automatically creates a new table called ImportErrors..
. » Read more: Clearing Access ImportError Tables

German Potato Salad

January 24, 2010 5 comments »

On this blog, Saturday is Bacon recipe day. So no Excel tips and tricks today. Today we learn about bacon.

 

Today, we'll do a little comfort food. Mrs. Pig is fond of German Potato salad. She's from Buffalo New York where all the Polacks there love perogies, sausage and potato salad.

I've had it a few times and I must say that it's very tasty. I'm pretty sure it's the Bacon that makes it good.

  » Read more: German Potato Salad

Bacon Driven Traffic

January 22, 2010 4 comments »

So I'm checking my Google Analytics stats, and what do I see? Bacon searches are actually driving traffic to my site.

Here is a portion of my Source Traffic table:

» Read more: Bacon Driven Traffic

Using Percentages with Scroll Bars

January 21, 2010 6 comments »

I recieved an email from Hari, who writes:

"I saw your post about smart scrollbars...how do I make scrollbars accept percentages?"

First of all Hari, may I say you have great taste when it comes to the Blogs you read. Now to answer your question:

Unfortunately, Scroll Bars in Excel only accept integers. That is to say, it can't pass values like .82.  The trick is to use a simple formula to convert the whole number outputs from the Scroll Bar.

. » Read more: Using Percentages with Scroll Bars