Best of PHD – Jan 2009

Share

Facebook
Twitter
LinkedIn

January 2009 will be one of the most memorable months since I started blogging. It is a perfect example of how uncertain life is. The month started with me receiving MVP award, then the website went down due to excessive server load and then we crossed 2000 RSS subscribers milestone and celebrated it with a huge 100 excel tips post. It just shows how uncertain things can be.

We had 105k page views from 47k visitors in Jan 2009 despite the server outages. Our e-mail subscriber base crossed 500 members and total RSS subscriber base is now at 2040. There were 19 posts and 247 comments (wow) in last month. I am really thankful to our readers. You constantly motivate me to learn and share beautiful things about excel and charting. The journey is becoming more and more enriching each day for me. I hope you are enjoying the ride as much.

Here is a list of 5 best posts from Jan 2009, in case you have missed out the whole month or new to this blog, check this posts out to make sure you have squeezed enough from this blog.

Automatically Insert Time Stamps in Excel [12 comments]
Excel Formula Wish list [25 comments]
6 ways to stack your column charts [17 comments]
Hide worksheet tabs in excel [14 comments]
100 Excel Tips & Resources [10 comments]

PHD needs your help, Please

Please take a moment and help me spread this blog. You can easily help by just saving this blog to your technorati favorites or delicious bookmarks or stumbleupon pages or emailing a friend about this site. That is a all it takes, just few clicks to show your love and support.

You can also help me by making PHD a better place. Please suggest article ideas, guest contributions, tips or just say “hello” by writing to me at chandoo . d @ gmail.com.  I don’t know how you feel seeing emails from strangers, but I really *love* seeing emails from strangers.

Have a great february everyone. We have some delicious posts coming up, so stay tuned and stay happy.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

6 Responses to “Make VBA String Comparisons Case In-sensitive [Quick Tip]”

  1. Rick Rothstein (MVP - Excel) says:

    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

    • Fares Al-Dhabbi says:

      That's a cool way to compare. i just converted my values to strings and used the above code to compare. worked nicely

      Thanks!

  2. Tim says:

    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.

  3. Luke M says:

    Nice tip, thanks! I never even thought to think there might be an easier way.

  4. Cyril Z. says:

    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 🙂

  5. Bhavik says:

    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

Leave a Reply