#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Macro Help

I am using this Macro in excell 2007 & works well & when i use it for 2003 i
get a run time error 1004 alarm WHY!! can this be changed so it can be used
for both .
WHEN alarm come the debug screen come up &
Sh.Tab.ColorIndex = 3 'red for me high lights yellow
Sh.Tab.ColorIndex = 2 'White for me High lights yellow

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim myRngToInspect As Range

Set myRngToInspect = Sh.Range("C300")

If Target.Cells.Count 1 Then
Exit Sub
End If

If Intersect(Target, myRngToInspect) Is Nothing Then
Exit Sub
End If

If UCase(Target.Value) = UCase("QC") Then
Sh.Tab.ColorIndex = 3 'red for me
Else
Sh.Tab.ColorIndex = 2 'White for me
End If

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Help

You never answered the follow-up questions from your post from Monday.

Mike wrote:

I am using this Macro in excell 2007 & works well & when i use it for 2003 i
get a run time error 1004 alarm WHY!! can this be changed so it can be used
for both .
WHEN alarm come the debug screen come up &
Sh.Tab.ColorIndex = 3 'red for me high lights yellow
Sh.Tab.ColorIndex = 2 'White for me High lights yellow

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim myRngToInspect As Range

Set myRngToInspect = Sh.Range("C300")

If Target.Cells.Count 1 Then
Exit Sub
End If

If Intersect(Target, myRngToInspect) Is Nothing Then
Exit Sub
End If

If UCase(Target.Value) = UCase("QC") Then
Sh.Tab.ColorIndex = 3 'red for me
Else
Sh.Tab.ColorIndex = 2 'White for me
End If

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Help

I guess you answered the questions in a new thread. As a rule, it's best to
stay in the same thread.

Just a couple of guesses...

Your workbook is protected.

You're not really running xl2003 on the other pc. What do you see under the
Help|about MS Office Excel?

Mike wrote:

I am using this Macro in excell 2007 & works well & when i use it for 2003 i
get a run time error 1004 alarm WHY!! can this be changed so it can be used
for both .
WHEN alarm come the debug screen come up &
Sh.Tab.ColorIndex = 3 'red for me high lights yellow
Sh.Tab.ColorIndex = 2 'White for me High lights yellow

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim myRngToInspect As Range

Set myRngToInspect = Sh.Range("C300")

If Target.Cells.Count 1 Then
Exit Sub
End If

If Intersect(Target, myRngToInspect) Is Nothing Then
Exit Sub
End If

If UCase(Target.Value) = UCase("QC") Then
Sh.Tab.ColorIndex = 3 'red for me
Else
Sh.Tab.ColorIndex = 2 'White for me
End If

End Sub


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Macro Help

I copied and pasted your code into Excel 2003 and it worked for me...

"Mike" wrote:

I am using this Macro in excell 2007 & works well & when i use it for 2003 i
get a run time error 1004 alarm WHY!! can this be changed so it can be used
for both .
WHEN alarm come the debug screen come up &
Sh.Tab.ColorIndex = 3 'red for me high lights yellow
Sh.Tab.ColorIndex = 2 'White for me High lights yellow

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim myRngToInspect As Range

Set myRngToInspect = Sh.Range("C300")

If Target.Cells.Count 1 Then
Exit Sub
End If

If Intersect(Target, myRngToInspect) Is Nothing Then
Exit Sub
End If

If UCase(Target.Value) = UCase("QC") Then
Sh.Tab.ColorIndex = 3 'red for me
Else
Sh.Tab.ColorIndex = 2 'White for me
End If

End Sub


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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM


All times are GMT +1. The time now is 04:06 AM.

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"