I need help with macro

M

Mike

I have this macro right now ,when i type anything in cell C300 the tab does
change colour this is what i want. Now i want to Type only QC in this cell so
that the tab changes colour is this possible with modijying this macro


Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
If Intersect(Target, Range("C300")) Is Nothing Then Exit Sub
ActiveSheet.Tab.ColorIndex = 15
End Sub
 
D

Dave Peterson

Option Explicit
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 LCase(Target.Value) = LCase("qc") Then
sh.Tab.ColorIndex = 3 'red for me
Else
sh.Tab.ColorIndex = xlNone 'change it back
End If

End Sub

Much like the other worksheet_change event in your other thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Macro (password) 6
macro for Tab colour change 3
Macro Excell 03/07 2
Macro error 1
Macro Help 3
Making a macro only work on certain files 2
Need Help with Macro Security 1
Menu Macro Not Executing - Need Help 1

Top