Hello,
So I am trying to write a script that if column d has a value in it and column g has false then nothing happens. However if column d has a value and column g does not equal false, then it should turn red.
Here are the two scripts I have written:
Public Sub Test1()
Dim lastrow As Integer
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastrow
For j = 1 To lastrow
If Cells(i, 4).Value <> "" Then
If Cells(j, 7) <> "False" Then
Cells(j, 7).Interior.Color = vbRed
End If
End If
Next
Next
End Sub
--------------------------------------------------------------------------------------------
Public Sub Test2()
Dim lastrow As Integer
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastrow
For j = 1 To lastrow
If Cells(i, 4).Value <> "" And Cells(j, 7) <> "False" Then
Cells(j, 7).Interior.Color = vbRed
End If
Next
Next
End Sub
---------------------------------------------------------------------------------------------
There both extremely similar and both work on the first row, however it is not looping through any of the other row. Let me know if you have any ideas!
So I am trying to write a script that if column d has a value in it and column g has false then nothing happens. However if column d has a value and column g does not equal false, then it should turn red.
Here are the two scripts I have written:
Public Sub Test1()
Dim lastrow As Integer
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastrow
For j = 1 To lastrow
If Cells(i, 4).Value <> "" Then
If Cells(j, 7) <> "False" Then
Cells(j, 7).Interior.Color = vbRed
End If
End If
Next
Next
End Sub
--------------------------------------------------------------------------------------------
Public Sub Test2()
Dim lastrow As Integer
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastrow
For j = 1 To lastrow
If Cells(i, 4).Value <> "" And Cells(j, 7) <> "False" Then
Cells(j, 7).Interior.Color = vbRed
End If
Next
Next
End Sub
---------------------------------------------------------------------------------------------
There both extremely similar and both work on the first row, however it is not looping through any of the other row. Let me know if you have any ideas!