My polar clock using donut charts in excel started a conversation and readers have been awesome enough to download the excel and create their own clocks to show time. Even though the idea of this blog is share the little that I know with you, it is amazing how much I have learned from you all. It just emphasizes that what ever you give away will come back to you in better shape.
So here are few ideas the readers have shared with me through mail / comments.

The polar chart with animation effect
Reader darone commented that he created a macro to hit “f9” repetitively thus creating the animation effect. My friend Jon took it a step further created the animation using some nifty VBA and shared the spreadsheet here. Download and play with it to learn how to run a function periodically using VBA. The key part of the code is:
Application.OnTime Now + TimeValue("0:0:1"), Me.CodeName & "." & "doThis"
The above line would tell MS-Office to run doThis after 1 second from NOW. If you include this line in the code of doThis() then every time it runs, it tells windows to relaunch the function after one second. Very neat and effective way to reduce processor overload that darone faced.
Also read Jon’s comments on the original polar clock post at time is on my side.

Swiss designer Chromachron clock using Pie charts in Excel
Robert, another avid reader and an excel guru liked the polar clock idea and thought why not create the famous chromachron clock in excel. For those of you who are unfamiliar with it, chromachron is a clock that tells time on a color-time-circle.
On a chronometer time is shown by hands and numerals. Differently on Chromachron, the color-time-watch: Its face is not a dial but a color-time-circle, over which a black disk revolves with a piece cut out as large as a color segment. The disk revolves with the speed of one color area per hour. The disk cut-out indicates the time.
So Robert took 2 pie charts, one with 12 colors to get the background. Another with 2 colors one black and another transparent to get the rotating disc effect. So when the time 12:00, you can see yellow portion alone, as you move towards 1:00 you will see more orange color. Download and play with Robert’s sheet.
Both these files have VBA on them so you may want to enable it to get the desired results, but they are safe so go crazy 😀
After seeing this two fine examples I had to do one more clock. This time I choose the grid based clock and did it in an excel grid using conditional formatting to fill cells. How did I do it, well that is your home work. Go figure…

Need more clock ideas? Try the procrastinator’s clock or some other idea featured on the 10 creative ways to show time
More on Clocks: Give your time series data a twist, plot around clock
More on Visualization fun: Tag clouds in excel using VBA, Square Pies in Excel, not everything is round, Olympic Medals on a map

















6 Responses to “Make VBA String Comparisons Case In-sensitive [Quick Tip]”
Another way to test if Target.Value equal a string constant without regard to letter casing is to use the StrCmp function...
If StrComp("yes", Target.Value, vbTextCompare) = 0 Then
' Do something
End If
That's a cool way to compare. i just converted my values to strings and used the above code to compare. worked nicely
Thanks!
In case that option just needs to be used for a single comparison, you could use
If InStr(1, "yes", Target.Value, vbTextCompare) Then
'do something
End If
as well.
Nice tip, thanks! I never even thought to think there might be an easier way.
Regarding Chronology of VB in general, the Option Compare pragma appears at the very beginning of VB, way before classes and objects arrive (with VB6 - around 2000).
Today StrComp() and InStr() function offers a more local way to compare, fully object, thus more consistent with object programming (even if VB is still interpreted).
My only question here is : "what if you want to binary compare locally with re-entering functions or concurrency (with events) ?". This will lead to a real nightmare and probably a big nasty mess to debug.
By the way, congrats for you Millions/month visits 🙂
This is nice article.
I used these examples to help my understanding. Even Instr is similar to Find but it can be case sensitive and also case insensitive.
Hope the examples below help.
Public Sub CaseSensitive2()
If InStr(1, "Look in this string", "look", vbBinaryCompare) = 0 Then
MsgBox "woops, no match"
Else
MsgBox "at least one match"
End If
End Sub
Public Sub CaseSensitive()
If InStr("Look in this string", "look") = 0 Then
MsgBox "woops, no match"
Else
MsgBox "at least one match"
End If
End Sub
Public Sub NotCaseSensitive()
'doing alot of case insensitive searching and whatnot, you can put Option Compare Text
If InStr(1, "Look in this string", "look", vbTextCompare) = 0 Then
MsgBox "woops, no match"
Else
MsgBox "at least one match"
End If
End Sub