Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Changing values in a row based on a cell in the row.
Hi, I have a little matrix 5R x 6C. All cells within the matrix have data validation in them to restrict the input to "1" or "0". It is OK to have mutiple selections of "1's" in the same row, except if the user happen to select a "1" for the sixth or last cell in the row. If that happens I would like the other five cells in that row to have a value of "0". Something like A B C D E F 1 1 0 0 1 1 0 ok 2 1 0 1 0 0 1 Not ok 3 0 0 0 0 0 1 ok 4 5 -- Casey ------------------------------------------------------------------------ Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545 View this thread: http://www.excelforum.com/showthread...hreadid=466377 |
#2
|
|||
|
|||
Once the user has enter the data, run this little macro
Sub fixit() Dim i As Integer For i = 1 To 5 If Cells(i, 6) = 1 Then Cells(i, 1) = 0 Cells(i, 2) = 0 Cells(i, 3) = 0 Cells(i, 4) = 0 End If Next End Sub -- Gary''s Student "Casey" wrote: Hi, I have a little matrix 5R x 6C. All cells within the matrix have data validation in them to restrict the input to "1" or "0". It is OK to have mutiple selections of "1's" in the same row, except if the user happen to select a "1" for the sixth or last cell in the row. If that happens I would like the other five cells in that row to have a value of "0". Something like A B C D E F 1 1 0 0 1 1 0 ok 2 1 0 1 0 0 1 Not ok 3 0 0 0 0 0 1 ok 4 5 -- Casey ------------------------------------------------------------------------ Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545 View this thread: http://www.excelforum.com/showthread...hreadid=466377 |
#3
|
|||
|
|||
Gary, Thank you for your answer. I have been ill and couldn't reply to you. I haven't had a chance to try your code but it looks like what I need. Again thank you. -- Casey ------------------------------------------------------------------------ Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545 View this thread: http://www.excelforum.com/showthread...hreadid=466377 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I copy values from one cell in a column down to the next c | Excel Discussion (Misc queries) | |||
Cell linked to a range of cell values in different sheet | Excel Discussion (Misc queries) | |||
Store values of a dynamically changing cell | Excel Worksheet Functions | |||
Changing Cell formats to date fields automatically | Excel Worksheet Functions | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) |