+ Reply to Thread
Results 1 to 6 of 6

Upper and Lower case in a Count

Hybrid View

  1. #1
    Registered User
    Join Date
    01-18-2007
    Posts
    17
    Function GetCnt(st As String)
    Application.Volatile
    Dim cnt As Long
    cnt = 0
    For i = 2 To Sheets.Count
    If Sheets(i).Range(Application.Caller.Address) = st Then cnt = cnt + 1
    Next i
    GetCnt = cnt
    End Function

  2. #2
    Registered User
    Join Date
    09-06-2006
    Location
    Italy
    Posts
    11
    Quote Originally Posted by CanMan12
    Function GetCnt(st As String)
    Application.Volatile
    Dim cnt As Long
    cnt = 0
    For i = 2 To Sheets.Count
    If Sheets(i).Range(Application.Caller.Address) = st Then cnt = cnt + 1
    Next i
    GetCnt = cnt
    End Function
    Ok,

    change that function into:
    Function GetCnt(st As String)
    Application.Volatile
    Dim cnt As Long
    cnt = 0
    For i = 2 To Sheets.Count
        If Sheets(i).Range(Application.Caller.Address) = Ucase(st) Or Sheets(i).Range(Application.Caller.Address) = Lcase(st) Then cnt = cnt + 1
    Next i
    GetCnt = cnt
    End Function
    and let me know if it worked.


    ciao

  3. #3
    Registered User
    Join Date
    01-18-2007
    Posts
    17

    Thumbs up

    Worked like a charm! Thank you very much!

  4. #4
    Registered User
    Join Date
    09-06-2006
    Location
    Italy
    Posts
    11
    Quote Originally Posted by CanMan12
    Worked like a charm! Thank you very much!
    You are welcome.

    ciao

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1