re-post
On May 17, 12:44 pm, Gary''s Student
wrote:
This is a sample for row 7. The value goes in A7. The color tested for is
green #10:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A7").Value = 0
For i = 1 To Columns.Count
If Cells(7, i).Interior.ColorIndex = 10 Then
Range("A7").Value = 1
Exit Sub
End If
Next
End Sub
This goes in the Worksheet code area not a standard module. Once you have
colored a cell, move away from it to tell the routine you are done.
--
Gary''s Student - gsnu200722
Susan and Gary:
Thank you so much for your input!
Maybe my question is not clear. Please allow me to re-instate it.
I have two columns, say column C and D with unlimited rows. The text
or quantity starts in each row either from column C or Column D, but
not both. I will need to highlight the starting cell with green to
indicate that I need this row. Here is an example:
If I highlight C23 as green, I would like to return a value of 1 in
cell F23,
If I highlight C25 as green, I would like to return a value of 1 in
cell F25,
If I highlight D28 as green, I would like to return a value of 1 in
cell F28, etc.
Anyway, any cell under column F must be 1 or 0 depending on the cell
color under Column C OR Column D (not both) in the SAME ROW. Please
note that I can randomly add some new rows in the middle of the
worksheet. Those new rows will follow the same rules.
Any thoughts?
Thanks,
Jorge
|