Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,113
- Office Version
- 365
- Platform
- Windows
Hi All,
In working in the range E11:E180; how do I add an IF statement criteria to an already existing vba code below?
Whereby, IF cell E11 has an interior color red to then return that interior cell color?
I would like to add this criteria to an existing code, where it will not remove the interior cell color red for example E11 after that sub is completed.
So basically....
range E11:E180
IF cells of range has an interior color red to then return that cell of E11's interior cell back to red.
Here is a sample of the code:
This code is interrupting my Column E interior cell color and I do not want it to.
Please let me know, if you can help!
Thanks you!
pinaceous
In working in the range E11:E180; how do I add an IF statement criteria to an already existing vba code below?
Whereby, IF cell E11 has an interior color red to then return that interior cell color?
I would like to add this criteria to an existing code, where it will not remove the interior cell color red for example E11 after that sub is completed.
So basically....
range E11:E180
IF cells of range has an interior color red to then return that cell of E11's interior cell back to red.
Here is a sample of the code:
VBA Code:
Sub Test()
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "H").End(xlUp).row
For i = 1 To Lastrow
If Cells(i, "H").Interior.Color = vbRed Then Cells(i, "H").Value = "Enter Tally"
Next
End Sub
This code is interrupting my Column E interior cell color and I do not want it to.
Please let me know, if you can help!
Thanks you!
pinaceous
Last edited: