Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with Arguments

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with Arguments

Thanks - got rid of the error but it still doesn't work - someone else
suggested the cap lock key - I may try that :(

"Andrew Taylor" wrote:


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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Help with Arguments

It works for me - as long as the target cell is in the range
H141:AK24.
Is that the correct range? The specification is valid but unusual:
H24:AK141 is equivalent and probably clearer.

BTW it occurred to me after I sent my first message that you
should use
If Target < UCase(Target) Then Target = UCase(Target)
to stop the event being triggered repeatedly.

Andrew


On Jul 25, 4:10 pm, betany70
wrote:
Thanks - got rid of the error but it still doesn't work - someone else
suggested the cap lock key - I may try that :(



"Andrew Taylor" wrote:

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- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with Arguments

Nothing better than another set of eyes - I missed a 1 when I was updating -
range should have been H14:AK24 - I made the change to the stop event as well
- works like a charm!!!! Thanks so much!

"Andrew Taylor" wrote:

It works for me - as long as the target cell is in the range
H141:AK24.
Is that the correct range? The specification is valid but unusual:
H24:AK141 is equivalent and probably clearer.

BTW it occurred to me after I sent my first message that you
should use
If Target < UCase(Target) Then Target = UCase(Target)
to stop the event being triggered repeatedly.

Andrew


On Jul 25, 4:10 pm, betany70
wrote:
Thanks - got rid of the error but it still doesn't work - someone else
suggested the cap lock key - I may try that :(



"Andrew Taylor" wrote:

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- Hide quoted text -


- Show quoted text -




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Too few arguments plore Excel Worksheet Functions 5 July 19th 12 02:36 PM
IF-more than 7 arguments in Carolina Excel Worksheet Functions 2 May 20th 08 08:46 PM
VBA ATP arguments Jim Excel Programming 2 May 3rd 04 08:11 PM
Arguments... rci Excel Programming 0 March 2nd 04 10:43 PM
How Many Arguments? Jerry W. Lewis Excel Programming 4 November 3rd 03 01:25 PM


All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"