Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Casey
 
Posts: n/a
Default 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   Report Post  
Gary''s Student
 
Posts: n/a
Default

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   Report Post  
Casey
 
Posts: n/a
Default


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I copy values from one cell in a column down to the next c GSingh Excel Discussion (Misc queries) 9 August 16th 05 11:18 AM
Cell linked to a range of cell values in different sheet szeng Excel Discussion (Misc queries) 1 August 9th 05 02:41 AM
Store values of a dynamically changing cell Yogesh Excel Worksheet Functions 0 August 4th 05 06:40 PM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM


All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"