Kenja824
Automotive
- Nov 5, 2014
- 950
I tried man. I really did, but I can only go so long making no progress.... To make it worse, I thought of something else I need to do and cant remember what it was now. lol
Column "Number" or "ROB#" will be filled with a date similar to...
AA010_R01_B05
The only part of this data I am interested in right this moment is the R01. It might be R01, R02, R03, R04, R05 or R06.
I need the color for the entire row of data in the table to change according to which R0# it is.
I was finding articles on using VB to change rows according to column data, but nothing on using a formula to find a specific text inside a string. Or any formula for that matter. Which would have helped if I found that much.
The last VB code I tried to manipulate looks like this.....
Dim rng As Range
Dim i As Integer
Application.ScreenUpdating = False
Set rng = Range("a2:az1250")
i = 2
Do Until i = 10
With rng
If Cells(i, 6).Value = "=ISNUMBER(SEARCH("R01",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 36
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R02",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 40
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R03",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 38
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R04",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 35
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R05",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 24
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R05",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 15
Else
Cells(i, 6).Interior.ColorIndex = 2
End If
End With
i = i + 1
Loop
Application.ScreenUpdating = True
But I think I got this all screwed up or something. lol It is times like this I realize just how little I understand of VB code. lol Im decent with formulas but I suck at code. lol
Column "Number" or "ROB#" will be filled with a date similar to...
AA010_R01_B05
The only part of this data I am interested in right this moment is the R01. It might be R01, R02, R03, R04, R05 or R06.
I need the color for the entire row of data in the table to change according to which R0# it is.
I was finding articles on using VB to change rows according to column data, but nothing on using a formula to find a specific text inside a string. Or any formula for that matter. Which would have helped if I found that much.
The last VB code I tried to manipulate looks like this.....
Dim rng As Range
Dim i As Integer
Application.ScreenUpdating = False
Set rng = Range("a2:az1250")
i = 2
Do Until i = 10
With rng
If Cells(i, 6).Value = "=ISNUMBER(SEARCH("R01",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 36
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R02",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 40
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R03",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 38
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R04",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 35
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R05",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 24
ElseIf Cells(i, 6).Value = "=ISNUMBER(SEARCH("R05",[@Number]))" Then
Cells(i, 6).Interior.ColorIndex = 15
Else
Cells(i, 6).Interior.ColorIndex = 2
End If
End With
i = i + 1
Loop
Application.ScreenUpdating = True
But I think I got this all screwed up or something. lol It is times like this I realize just how little I understand of VB code. lol Im decent with formulas but I suck at code. lol