I need help!!

jovie

Board Regular
Joined
Nov 13, 2015
Messages
68
I write a program to set when I key in in one cell in a column, and the other two column meet the requirement, so the row of it will become to red color, and when I key in in one cell in another column, and another two column will fail to meet the requirement, so the row will become not fill in with any color
Here is my program
If Target.Row > 7 And Target.Column = 8 Then
u = Cells(Target.Row, "U")
v = Cells(Target.Row, "V")
If (u > 5 And v < 8) Or (u < 5 And v < 4) Then
MsgBox "Storage is Low, Please Proceed to Order"
Range("C:V" & Target.Row).Interior.ColorIndex = 3

End If
End If
If Target.Row > 7 And Target.Column = 18 Then
u = Cells(Target.Row, "U")
v = Cells(Target.Row, "V")
If (u > 5 And v > 8) Or (u < 5 And v > 4) Then
Range("C:V" & Target.Row).Interior.Pattern = xINone
End If
End If

However ,the row I select wont turn red and it show error 1004
after I cange the C:V to C, it work ,but it is not working as I try to unfill the color
I mean when I key in data in cells in column 18
 
This:

Range("C:V" & Target.Row)

is not a valid range object. Try:

Range("C" & Target.Row, "V" & Target.Row)
 
Upvote 0
Thanks a lot, But How should I do to un fill the color, As I want it to be like I key in data in Column 18, so it change the data in V, so as V nv meet the requirement, Therefore, it will be not fill
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top