Trying to Capitalise on Input to Cells

J

John

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
 
A

Ardus Petus

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

HTH
 
G

Guest

Try:

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

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top