+ Reply to Thread
Results 1 to 3 of 3

Changing values in a row based on a cell in the row.

  1. #1
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245

    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

  2. #2
    Gary''s Student
    Guest

    RE: Changing values in a row based on a cell in the row.

    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. #3
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245
    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1