This should be all that you need
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Const WS_RANGE As String = "D4:AJ380"
On Error GoTo Error_handler
Application.EnableEvents = False
With Target
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
If Not Target.HasFormula Then
Target.Value = UCase(Target.Value)
End If
End If
End With
Error_handler:
Application.EnableEvents = True
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

Signature
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> Hi,
>
[quoted text clipped - 36 lines]
> Error_handler:
> Application.EnableEvents = True
AA Arens - 30 Jul 2007 13:05 GMT
> This should be all that you need
>
[quoted text clipped - 68 lines]
> > Error_handler:
> > Application.EnableEvents = True
I get an error message: Method or data member not found
at .Range in: If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing
Then
Rick Rothstein (MVP - VB) - 30 Jul 2007 15:33 GMT
> I get an error message: Method or data member not found
>
> at .Range in: If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing
> Then
If looks like it will work if you change the 'Me' object to 'ActiveSheet'...
If Not Intersect(Target, ActiveSheet.Range(WS_RANGE)) Is Nothing Then
Rick
Dave Peterson - 30 Jul 2007 16:14 GMT
Remember that this is a worksheet event and the code goes in a worksheet module.
Read Bob's instructions one more time.
<<snipped>>
> > 'This is workbook event code.
> > 'To input this code, right click on the Excel icon on the worksheet
> > '(or next to the File menu if you maximise your workbooks),
> > 'select View Code from the menu, and paste the code
<<snipped>>
> I get an error message: Method or data member not found
>
> at .Range in: If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing
> Then

Signature
Dave Peterson
Rick Rothstein (MVP - VB) - 30 Jul 2007 17:20 GMT
> > > (B) How to have this script for all sheets, so to have it on workbook
> > > level? And, how to avoid that other excel documents that are opened
[quoted text clipped - 3 lines]
> Remember that this is a worksheet event and the code goes in a worksheet
> module.
???
Bob said it was workbook event code and the OP said he wanted it to work on
all sheets in his open workbook.
Rick
Dave Peterson - 30 Jul 2007 17:47 GMT
Oops. You (and Bob) are right.
The line should be changed to:
If Not Intersect(Target, Sh.Range(WS_RANGE)) Is Nothing Then
> > > > (B) How to have this script for all sheets, so to have it on workbook
> > > > level? And, how to avoid that other excel documents that are opened
[quoted text clipped - 10 lines]
>
> Rick

Signature
Dave Peterson
Bob Phillips - 30 Jul 2007 20:39 GMT
> Oops. You (and Bob) are right.
>
> The line should be changed to:
> If Not Intersect(Target, Sh.Range(WS_RANGE)) Is Nothing Then
And Bob is wrong (as you noted). I could have sworn I posted a correction to
that.
Dave Peterson - 31 Jul 2007 01:19 GMT
But Bob was correct about how to install the macro.
(Sometimes, when someone (me) only glances at the code, it can all look the
same. I saw the me reference, so I thought it was a worksheet_change event. I
should have glanced up!)
> > Oops. You (and Bob) are right.
> >
[quoted text clipped - 3 lines]
> And Bob is wrong (as you noted). I could have sworn I posted a correction to
> that.

Signature
Dave Peterson