I have a short code but I need to tailor it to my needs, for the most part I am successful.
1. Originally "i" was "For i = 1 To 3", I tried to change it but its not working (I have made that part in Red font to make it easier to see my mess up).
2. For the range, is there a way I can only gear it to a certain cell color (for example RGB 255,0,0)?
Thanks
1. Originally "i" was "For i = 1 To 3", I tried to change it but its not working (I have made that part in Red font to make it easier to see my mess up).
2. For the range, is there a way I can only gear it to a certain cell color (for example RGB 255,0,0)?
Thanks
VBA Code:
Private Sub CommandButton1_click()
Dim mycell As Range
Dim myrange As Range
Set myrange = Worksheets("Sheet1").Range("D4:AD72")
For Each mycell In myrange
[COLOR=rgb(184, 49, 47)]For i = Worksheets("Sheet1").Range("E5")[/COLOR]
If mycell.Value = Application.WorksheetFunction.Small(myrange, i) Then
mycell.Interior.Color = 6750054
Else
cell.Interior.Color = 14929080 'BLUE
End If
Next
Next mycell
End Sub