ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   set to upper with code (https://www.excelbanter.com/excel-programming/341791-set-upper-code.html)

David

set to upper with code
 
Hi Group,
I want to compare text objects, but upper case and lower case are messing it
up.
This is the code I have:
Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
Set ThisCustomer = ActiveCell.Value
Set ColACustomer = Range("A" & (ActiveCell.Row)).Value

I want to set both ThisCustomer and ColACustomer to upercase then I will
compare them. I believe I will have to use the application object, but am not
sure?
Thanks for your help.
--
David

Tom Ogilvy

set to upper with code
 
since your two variables are typed as text, you don't use SET

Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
ThisCustomer = Ucase(ActiveCell.Value)
ColACustomer = Ucase(Range("A" & ActiveCell.Row).Value(
if ThisCustomer = ColaCustomer then


--
Regards,
Tom Ogilvy


"David" wrote in message
...
Hi Group,
I want to compare text objects, but upper case and lower case are messing

it
up.
This is the code I have:
Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
Set ThisCustomer = ActiveCell.Value
Set ColACustomer = Range("A" & (ActiveCell.Row)).Value

I want to set both ThisCustomer and ColACustomer to upercase then I will
compare them. I believe I will have to use the application object, but am

not
sure?
Thanks for your help.
--
David




David

set to upper with code
 
Thanks Tom
--
David


"Tom Ogilvy" wrote:

since your two variables are typed as text, you don't use SET

Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
ThisCustomer = Ucase(ActiveCell.Value)
ColACustomer = Ucase(Range("A" & ActiveCell.Row).Value(
if ThisCustomer = ColaCustomer then


--
Regards,
Tom Ogilvy


"David" wrote in message
...
Hi Group,
I want to compare text objects, but upper case and lower case are messing

it
up.
This is the code I have:
Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
Set ThisCustomer = ActiveCell.Value
Set ColACustomer = Range("A" & (ActiveCell.Row)).Value

I want to set both ThisCustomer and ColACustomer to upercase then I will
compare them. I believe I will have to use the application object, but am

not
sure?
Thanks for your help.
--
David





Gary Keramidas[_4_]

set to upper with code
 
is the dim as text a userdefined item?

--


Gary


"Tom Ogilvy" wrote in message
...
since your two variables are typed as text, you don't use SET

Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
ThisCustomer = Ucase(ActiveCell.Value)
ColACustomer = Ucase(Range("A" & ActiveCell.Row).Value(
if ThisCustomer = ColaCustomer then


--
Regards,
Tom Ogilvy


"David" wrote in message
...
Hi Group,
I want to compare text objects, but upper case and lower case are messing

it
up.
This is the code I have:
Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
Set ThisCustomer = ActiveCell.Value
Set ColACustomer = Range("A" & (ActiveCell.Row)).Value

I want to set both ThisCustomer and ColACustomer to upercase then I will
compare them. I believe I will have to use the application object, but am

not
sure?
Thanks for your help.
--
David






Tom Ogilvy

set to upper with code
 
My typo:

Dim ThisCustomer As String
Dim ColACustomer As String

--
Regards,
Tom Ogilvy


"Gary Keramidas" wrote in message
...
is the dim as text a userdefined item?

--


Gary


"Tom Ogilvy" wrote in message
...
since your two variables are typed as text, you don't use SET

Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
ThisCustomer = Ucase(ActiveCell.Value)
ColACustomer = Ucase(Range("A" & ActiveCell.Row).Value(
if ThisCustomer = ColaCustomer then


--
Regards,
Tom Ogilvy


"David" wrote in message
...
Hi Group,
I want to compare text objects, but upper case and lower case are

messing
it
up.
This is the code I have:
Dim ThisCustomer As Text
Dim ColACustomer As Text
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
Set ThisCustomer = ActiveCell.Value
Set ColACustomer = Range("A" & (ActiveCell.Row)).Value

I want to set both ThisCustomer and ColACustomer to upercase then I

will
compare them. I believe I will have to use the application object, but

am
not
sure?
Thanks for your help.
--
David









All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com