ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UCase with Worksheet_Change and Target Address (https://www.excelbanter.com/excel-programming/371731-ucase-worksheet_change-target-address.html)

David

UCase with Worksheet_Change and Target Address
 
If a small letter is entered into a specific cell, I need it to be upper case
or to have the code recognize either lower or upper case for the
Worksheet_Change to fire. I've tried putting the UCase in, but nothing is
working. Here is the code without the UCase in it: I Need L23 to be
Upper Case for this to work currently.
If Target.Address = "$L$23" Then
Set Target = Range("K23")
DWSat = Range("K23")
BSat = Range("L23")
If BSat = "Y" And DWSat = 0 Then
MsgBox "You Have Turned On Your Budget. You Must Now Set a Daily
Daily Weight!", Buttons:=vbExclamation
Target.Select
End If
End If

Tom Ogilvy

UCase with Worksheet_Change and Target Address
 

If Target.Address = "$L$23" Then

DWSat = Range("K23")
BSat = Ucase(Range("L23").Value)
If BSat = "Y" And DWSat = 0 Then
MsgBox "You Have Turned On Your Budget. " & _
"You Must Now Set a Daily Daily Weight!", Buttons:=vbExclamation
Range("K23").Select
End If
End If

I would advise against trying to set Target to reference another cell.

--
Regards,
Tom Ogilvy


"David" wrote in message
...
If a small letter is entered into a specific cell, I need it to be upper
case
or to have the code recognize either lower or upper case for the
Worksheet_Change to fire. I've tried putting the UCase in, but nothing is
working. Here is the code without the UCase in it: I Need L23 to be
Upper Case for this to work currently.
If Target.Address = "$L$23" Then
Set Target = Range("K23")
DWSat = Range("K23")
BSat = Range("L23")
If BSat = "Y" And DWSat = 0 Then
MsgBox "You Have Turned On Your Budget. You Must Now Set a Daily
Daily Weight!", Buttons:=vbExclamation
Target.Select
End If
End If




David

UCase with Worksheet_Change and Target Address
 
Tom....my deepest appreciation for all your help these past two weeks on this
project. It has been received extremely well...and it was with your help that
I was able to provide such an amazing piece of "ART"!
Thank you again so much for your assistance!!

David

"Tom Ogilvy" wrote:


If Target.Address = "$L$23" Then

DWSat = Range("K23")
BSat = Ucase(Range("L23").Value)
If BSat = "Y" And DWSat = 0 Then
MsgBox "You Have Turned On Your Budget. " & _
"You Must Now Set a Daily Daily Weight!", Buttons:=vbExclamation
Range("K23").Select
End If
End If

I would advise against trying to set Target to reference another cell.

--
Regards,
Tom Ogilvy


"David" wrote in message
...
If a small letter is entered into a specific cell, I need it to be upper
case
or to have the code recognize either lower or upper case for the
Worksheet_Change to fire. I've tried putting the UCase in, but nothing is
working. Here is the code without the UCase in it: I Need L23 to be
Upper Case for this to work currently.
If Target.Address = "$L$23" Then
Set Target = Range("K23")
DWSat = Range("K23")
BSat = Range("L23")
If BSat = "Y" And DWSat = 0 Then
MsgBox "You Have Turned On Your Budget. You Must Now Set a Daily
Daily Weight!", Buttons:=vbExclamation
Target.Select
End If
End If






All times are GMT +1. The time now is 11:52 PM.

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