The other day my wife told me that we dream about a total of 6 years in our life, an average of 2 hours for everyday you sleep. [Source: wikipedia on dreams]. That is almost as much time as you would work in 30 years (30*50*40/24/365, assuming you work 40 hours a week for 50 weeks an year). As much as total working life for some of us. And yet, hardly anyone of us care enough dreams, but care enough about work to dream about it.
May be it is time we took dreams more seriously and saw what we can do about them!
Okay, back to another addition of weekly excel links where I share some of the wonderful excel articles posted on the web in the last week so that you can get great ideas and nifty spreadsheet tips.
Calculating Easter in Excel, apparently calculating the date on which Easter falls this year is much more difficult than celebrating it. [via Jon Peltier]
Open your excel files faster by adding them to “My places” this could save a lot of time if you open several spreadsheets during the course of day. Daily dose of excel provides a simple tutorial on how to add files to “My places” on xp.
Accessing excel from linux programs, this is very useful if your linux code needs to process xls / csv files saved MS Excel and do something with them. Accessing excel from programs is my first big assignment in my first job and that is when my love for excel began. Of course, then the challenge was to use Java to create excel files with sales reports and we used POI HSSF to do a majority of that. [via MSDN Excel blog]
Want to share a link? Drop a comment.
Also see:

















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