View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default Help with Arguments


It should be:

If Not Intersect(Target, Range("H141:AK24")) Is Nothing Then
Target = UCase(Target)
End If

The error message was telling you that the Intersect function
takes two arguments, and you only gave it one.



On Jul 25, 3:44 pm, betany70
wrote:
I am relatively new to VB coding-

Someone suggested this as a way to change lower case letter to upper case
letter when entered incorrectly by the user. I receive a Compile Error -
Argument not Optional. Any idea what I am doing wrong?

Right click sheet tabview codeinsert thismodify to suit your rangeSAVE
workbook.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Range("H141:AK24")) Is Nothing Then
Target = UCase(Target.Range)
End If
End Sub