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

This is the Macro im using & i know why im getting an error (i have a
password for protecting structure) is there any possible way i can do this &
change Macro to accomodate & how i am not very good with Macro,s



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


s is the Macro im using & I know why im getting an error
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 834
Default Macro error

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

Me.Unprotect "password"

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

Me.Protect "password"

End Sub


---
HTH

Bob Phillips


"Mike" wrote in message
...
This is the Macro im using & i know why im getting an error (i have a
password for protecting structure) is there any possible way i can do
this &
change Macro to accomodate & how i am not very good with Macro,s



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


s is the Macro im using & I know why im getting an error



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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro Error The Toasterman Excel Discussion (Misc queries) 4 June 30th 06 01:44 PM
Macro error : Application-defined or object-defined error Joe Excel Discussion (Misc queries) 3 January 27th 06 02:32 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 09:07 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"