The Life of a Lion Tamer

I know you guys have been immensely interested in how I spend my day (here and here and here). I pivoted the data from my TaskIt worksheet for this week and here it is. I think I’ll turn that into an add-in that creates the pivot table automatically and has a couple of menus.

If you don’t get the title, see YouTube. And if you like accounting humor (aka humour), then see Smurf On Spreadsheets

Task Recorder Version1

I’ve made my first iteration of a program to record my tasks (genesis here).

J-walk suggested:

Create a bunch of general work-oriented categories. Then, when the timer goes off, have XL display a Userform that lets you allocate the last hour by percent in each category. Even if you’re away from your desk when the timer goes off, the code can determine the time since the last entry and adjust.

Good idea, but I have two problems with it: First, it locks me into categories - or at least I can’t change them on the fly. That’s probably not as big of a deal as I think. In fact it might be better than having me go from too specific to too general in the category department. So maybe I don’t have a problem with it.

Second, I want to record the actual tasks. I want to answer the question, “I spent 4.2 hours on IT? What the hell did I do?”

Instead of recording tasks every half hour, I’ll record them whenever I switch tasks. Sometimes that will be five minutes and sometimes two hours. Here’s basically how it’s going to work:

When the workbook is loaded it checks to see if there are any entries. If there aren’t any entries or the last entry if not from today, a new entry is created that sets the time the day is started. Then the hotkey Ctrl+Shift+T is assigned to open the form. Finally OnTime is used to open the form in 30 minutes.

If I open the form and create an entry, the timer restarts. The timer serves as a reminder in case I forgot I’m supposed to be recording stuff. For longer tasks, I’ll just dismiss the form if I don’t have an entry to make.

The three buttons next to the date picker decrement the dtp by 10 minutes, increment the dtp by 10 minutes, and set the dtp equal to the current time, respectively. If I come back to my office and the form is showing, I can quickly change the time to now and record the task.

The Category combobox is seeded. That is, I came up with a number of categories that I wanted to include right from the start. But I can still make up whatever category I want. The combobox is populated by the seed categories plus whatever other categories exist in the database. I suppose this will get slower as the database gets bigger.

The listbox on the bottom shows the last eight entries, just for some perspective.

When saved, the time, category, and task are recorded onto the workbook. Right now the workbook is simply hidden. I’ll either copy it into XLSTART or make it an add-in.

You can download TaskIt.xls.zip

Update: You can download TaskItv2.xls.zip

Twittering Away the Day

The twitter experiment is now over. I used Tweetake to get my tweets into a CSV, which I then opened in Excel.

I tried to post every 1/2 hour. At the time of the post, I’d write what I did since the last post. Since I usually did more than one thing, I had to split each entry. My plan was to split the tasks evenly among the time. That is, if I did three things in 27 minutes, each thing would get 9 minutes. Not exact, but close enough for government work.

Rather than write a macro to split the tweet, I just did it manually. It probably took the same amount of time, but writing the macro would have been more fun. Once I split them, I used the old F5 Fill in the Blanks trick to extend the time, the id, and the description.

Next I parsed the day out using =DATEVALUE(MID(B2,5,6)&", "&MID(B2,27,4)) and the time using =TIMEVALUE(MID(B2,12,8)). The date/time Twitter exports is Mon Aug 25 12:30:34 +0000 2008.

To get the elapsed time, I used this formula =IF(C3<>C2,1/24/2,(D3-G3)/COUNTIF($A$3:$A$101,A3)).


Click to embiggen.

and in G3: =VLOOKUP(A3-1,$A$1:$H$101,4)

If there’s a change in the day, it’s assumed to be 30 minutes. Otherwise it takes the change in the time divided by the number of instances of that tweet. The previous time is calc’d in G3 using VLOOKUP without the fourth argument.

Finally, I made a pivot table. Class in the rows, sum of elapsed time in Data. Then I sorted on time and formatted the field.

Misc. includes lunch, general screwing around, and things I just couldn’t shoehorn into a category. Information System is time developing spreadsheets to do what Quickbooks simply cannot. Marketing is a little high because of a special project. Payroll is a little low because it wasn’t a payroll week. Time Management is time spent prioritizing what I have to do.

I think I’m done using Twitter for this purpose. Which means I’m probably done using Twitter altogether. We’ll see. But I had a very productive week this week and I think it was because I was going to be accountable, even if it was only to myself. I think I’d like to continue recording my time and get a full month of data. To do that, I’m going to write an Excel program where I can make a quick note and it will record the date, time, and category. Every time I make a note, a timer will start to remind me if I haven’t done it in 30 minutes. Of course I’ll post that here.

User Initials in Excel

In Excel, you can get the Username by using Application.UserName. The Username is what is entered on the General tab of Tools > Options. Inexplicably, you cannot get the user's initials, but you can in some other Office programs. I read a suggestion to automate Publisher and get the user initials via that object model. That seems a little extreme to me.

This is what I'm using. It gets the first character of, up to, the first three words in Application.Username.

Public Function UserInitials() As String
   
    Dim vaNames As Variant
    Dim sInit As String
    Dim lMax As Long
    Dim i As Long
   
    vaNames = Split(UCase(Application.UserName), " ")
   
    lMax = Application.WorksheetFunction.Min(2, UBound(vaNames))
   
    For i = 0 To lMax
        sInit = sInit & Left$(vaNames(i), 1)
    Next i
   
    UserInitials = sInit
   
End Function

Some testing:

Random Numbers Repeating

I write some data to an Access database, after which I retrieve the Autonumber that Access generates. Prior to writing the data, it sits in a class and all of the classes sit in a collection. The collection needs a unique string for each entry, so I create one until I can the proper one from Access. Just a place holder that's unique. Specifically, I use this code:

Public Sub Add(clsRoyaltyLine As CRoyaltyLine)
   
    If clsRoyaltyLine.RoyaltyLineID = 0 Then
        clsRoyaltyLine.RoyaltyLineID = Int(Rnd * 100000)
    End If
   
    mcolRoyLines.Add clsRoyaltyLine, CStr(clsRoyaltyLine.RoyaltyLineID)
    If Not mobjParent Is Nothing Then
        Set clsRoyaltyLine.Parent = Me.Parent
    End If
   
End Sub

If this record has already been written to Access or has already been created, it will have a RoyaltyLineID that's not zero. Otherwise I create a random number between 1 and 99,999 to serve as a unique id for the collection until such time as I can get a proper Autonumber from Access.

After thousands of RoyaltyLines processed, it finally broke. I was entering a particularly large order (the specific invoice line had 66 royalty lines), but only got to line 14 and I got a duplicate. The tenth RoyaltyLineID was the same as the fourteenth. To quote Phillip J. Fry:

Oh, the fools! If only they'd built it with 6,001 hulls! When will they learn?

I guess I'll increase it by an order of magnitude, but is there a better way?

Twitter

I signed up for Twitter a couple of months ago, made a few posts, and pretty much abandoned it. If you're not familiar with it, Twitter is a micro-blog. You make posts of 140 characters or less. I don't follow many people and I'm not sure what value this whole idea has. I know that NASA used it recently to keep people up-to-date on Mars/Phoenix. That seems like a pretty interesting use. I have to believe that an interplanetary mission is far more interesting that most people's day.

Last week I decided I was going to write down what I did all day for five straight days. Every 1/2 hour, or so, I will jot down a note about what I'm doing or what I've done over the last half hour. I think I have a good idea what I do all day, but I want some objective evidence to see if my perceptions match reality. I was thinking I need a little program that popped up a userform every 1/2 hour for me to type my note. Then I thought that Twitter might work well for this. It won't pop up a reminder, but at least I could make my notes from anywhere.

I'm not encouraging you to follow me on Twitter. It will be excruciatingly boring, I can assure you. However, if you ever wondered it what you're day would be like if you had chosen accountancy as a career, well this should be right up your alley. http://twitter.com/dkusleika