find case in a certain cell

Trevor3007

Active Member
Joined
Jan 26, 2017
Messages
490
hi,

I use the following code
Code:
  Dim Changed As Range, Cell As Range  
Dim Clr As Long
   Set Changed = Intersect(Target, Range("m2:k300"))
  If Not Changed Is Nothing Then
    For Each Cell In Changed
       Select Case LCase(Cell.Value)
         Case "win10":       Clr = 35
         Case "no":        Clr = 55
         Case "issue":     Clr = 39
         Case "b i p":     Clr = 28
         Case "emailed":   Clr = 27
         Case "built":     Clr = 7
         Case "t b a":     Clr = 46
         Case "n / a":       Clr = 45
         Case "e u":       Clr = 22
         Case Else:        Clr = xlNone
      End Select
      Rows(Cell.Row).Resize(, Cell.Column).Interior.ColorIndex = Clr
    Next Cell
  End If
It works fine, but is it vaible for 'Case "n / a"' to pick up a cell ref ( IE sheetname VB , cell ref a2 'Test' )


Hoping this makes sense & thank you for your help.
KR
Trevor3007
 

Trevor3007

Active Member
Joined
Jan 26, 2017
Messages
490
I don't understand what that means.

Hi,

thanks for your reply & sorry for the mix up.


curerently where it stats in the code ' Case "n / a" ', "n / a" may have to change , and rather than having to open the VB , it would look to a cell ( ie 'A2) and and would use the text in that cell.


Hope this now makes sense
:confused:
KR
Trevor3007
 

Trevor3007

Active Member
Joined
Jan 26, 2017
Messages
490
Case LCase(Range("A2").Value): Clr = 45

many thanks , very much appreciated.

however, the 'text' is in sheet4(Vb) cell a2. can you help ?

KR
trevor3007
 

Forum statistics

Threads
1,077,678
Messages
5,335,624
Members
399,029
Latest member
JSO

Some videos you may like

This Week's Hot Topics

Top