find case in a certain cell

Trevor3007

Active Member
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
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
 

Some videos you may like

This Week's Hot Topics

  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • find many based on a certain criteria
    good evening, I hope someone can help me? I have a workbook sheet 2 contains lots of data.... I would like to be able to find anything on sheet...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
  • Text Format
    I have a sheet for user to keyin the data. The format of the data can be 451 / 1903, 0012 / 9908 or 00287 / 0099. The number after the "/" is...
  • Macro to copy values across rows and transposing them and add the user id
    [FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]Hi,[/COLOR][/SIZE][/FONT] [FONT=Times New...
Top