(Solved) : Vba Trying Code Search Column Containing Phrase Ben Fh Mh Color Cells Phrases Depending Ph Q42789057 . . .

VBA

Trying to have code search through column containing phrase BEN,then FH, then MH, and color cells with those phrases depending onwhich phrase is in the cell. I tried it two different ways andneither worked

For r = 2 TO 85 If InStr (cell.Value, BEN) Then Cells(r, 2).Interior. Color = vbRed ElseIf InStr (cell.Value, FH) Then CellsE6 X MONDO А в 1 Pt_Num Name 1 BEN1 2 BEN2 3 BEN3 4 BENA 5 BENS 6 BEN6 7 BENZ 8 BENS 9 BENE 10 BEN10 11 BEN11 13 12 BEN12 с L

For r = 2 TO 85 If InStr (cell.Value, BEN) Then Cells(r, 2).Interior. Color = vbRed ElseIf InStr (cell.Value, FH) Then Cells (r, 2). Interior. Color = vbBlue ElseIf Cells (r, 2) = MH Then Cells(r, 2). Interior. Color = vbYellow End If Next r E6 X MONDO А в 1 Pt_Num Name 1 BEN1 2 BEN2 3 BEN3 4 BENA 5 BENS 6 BEN6 7 BENZ 8 BENS 9 BENE 10 BEN10 11 BEN11 13 12 BEN12 с Lat 29.64 29.64 29.64 29.64 29.6 29.64 29.64 29.64 29.6 29.64 29.64 29 64 Show transcribed image text For r = 2 TO 85 If InStr (cell.Value, BEN) Then Cells(r, 2).Interior. Color = vbRed ElseIf InStr (cell.Value, FH) Then Cells (r, 2). Interior. Color = vbBlue ElseIf Cells (r, 2) = MH Then Cells(r, 2). Interior. Color = vbYellow End If Next r
E6 X MONDO А в 1 Pt_Num Name 1 BEN1 2 BEN2 3 BEN3 4 BENA 5 BENS 6 BEN6 7 BENZ 8 BENS 9 BENE 10 BEN10 11 BEN11 13 12 BEN12 с Lat 29.64 29.64 29.64 29.64 29.6 29.64 29.64 29.64 29.6 29.64 29.64 29 64

Expert Answer


Answer to VBA Trying to have code search through column containing phrase BEN, then FH, then MH, and color cells with those phrase…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?