String comparison

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,835
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Having a problem dealing with sameness including casing with strings

Album is "LIVE!"
ThisRow!Title is "Live"
My first check fails
VBA Code:
If StrComp(Album, UCase(ThisRow!Title), vbBinaryCompare) = 0 Then
so then tried
VBA Code:
? Album <> UCase(ThisRow!Title)& "!"
But this failed too. Just wondering how others would handle this.
 
Weird... this is from the immediate window
? "HelLO" = Ucase("HelLO")
True
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
And when I copy/paste it into my Immediate Window, it returns False for me. Weird indeed! I am not sure what to tell you now about that.
 
Upvote 0
Aha, figured out why. Some of my VBA code I port between Excel and Access. Usually that's ok but Access has Option Compare Database giving different result.
In Excel I also get False. Whew! Sanity restored.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,305
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top