View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Forcing All Caps in input cells


Slave2Six wrote:
Ken,

The addition of this code has introduced a new challenge. In the
attached document, there is a VLOOKUP function that references the
"Product ID" columns. I used Range("$A$1:$EA$178") in the script that
you gave me. However, if I delete anything out of the Product ID
columns I now get a runtime error.

In reality, the only columns that I am concerned about are B, BC, and
DD.

Any sugestions?


Hi Slave2Six,

I thinks its a harmless error caused by you selecting then deleting a
range of more than 1 cell, Excel can't work with the values of more
than one cell at a time.

If I'm right, then the harmless error will be ignored, and no error
message will be displayed when you delete multiple cell values, after
you change to the following code...

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Application.Intersect(Target, _
Range("$A$1:$A$10")) Is Nothing Then
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
End If
Application.EnableEvents = True
End Sub


You will notice the only difference is the new first line..

On Error Resume Next

which you could easily type into the original code.

Let me know if that is the solution.

Ken Johnson