find case in a certain cell

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
675
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
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
:???:
KR
Trevor3007
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,154
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top