Greetings,
I created the following script to highlight cells with sales codes.
Sub highlightSalesCode()
Dim SalesCode As Range
Set SalesCode = Range("A1", "A2000"
Dim i As Integer
For i = 1 To SalesCode.Cells.Count
If SalesCode.Cells(i).Value Like "0###" Then
SalesCode.Cells(i).Interior.Color = vbYellow
End If
Next i
End Sub
I would like to alter the script so that it would store the value of the sales codes in different variables. The problem is that I have no clue how many sales code would exist in the report at any given time.
Any help would be much appreciated.
I created the following script to highlight cells with sales codes.
Sub highlightSalesCode()
Dim SalesCode As Range
Set SalesCode = Range("A1", "A2000"
Dim i As Integer
For i = 1 To SalesCode.Cells.Count
If SalesCode.Cells(i).Value Like "0###" Then
SalesCode.Cells(i).Interior.Color = vbYellow
End If
Next i
End Sub
I would like to alter the script so that it would store the value of the sales codes in different variables. The problem is that I have no clue how many sales code would exist in the report at any given time.
Any help would be much appreciated.