Thread: [Solved] * Determine Capitalization
View Single Post
 
Old 05-02-2011, 01:48 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Rey,

When doing the VBA comparison, wrap both expressions in the UCase function. This will force the comparison to be done on the basis of the capitalized versions of the strings.

Code:
Sub Demo()
With ActiveSheet
  If UCase(.Range("A1").Value) = UCase(.Range("B1").Value) Then
    MsgBox "!"
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 05-03-2011 at 01:23 AM.
Reply With Quote