View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers
 
Posts: n/a
Default Trying to Capitalise on Input to Cells

Try:

If Not Intersect(Target, Range("E9:E37, I9:I37, M9:M37,Q9:Q37 , U9:U37 "))
Is Nothing Then

HTH

"John" wrote:

I have the following Private Sub within my relevant sheet that I'm trying to
capitalise all values entered in a Range of cells, but it returns a syntax
error on entry, I guess its got to do with the way I've typed in the ranges
in the formula, can anyone assist?

Thanks


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("E9:E37"; "I9:I37", "M9:M37",
"Q9:Q37", "U9:U37")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub