Results 1 to 5 of 5

Changing values based on which cell is changed within a range.

Threaded View

  1. #1
    Registered User
    Join Date
    01-10-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Changing values based on which cell is changed within a range.

    Hi Guys,

    I've got a list of passwords that need to be updated at different times, and I'm trying to keep track of them via excel.
    The layout will have have Column A for Passwords, Column B for the number of days that the password will last before expiring, column C and D are the date that the password will expire, and Column E will contain the same as Column B.

    The goal is that when the password is changed in Column A, Column C and D will update to show when the password will expire. Column E will show the same as Column B.
    If the value in Column B changes, then Column C will show the result of "(Col-D minus Col-E) + Col-B". (Essentially adjusting the date that the password will expire.)

    I hope this is making sense. If not, maybe the attached document will explain it better.

    Currently I have this working using the following:

    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Target = Cells(8, 1) Then
        Cells(8, 3) = Date + Cells(8, 2)
        Cells(8, 4) = Date + Cells(8, 2)
        Cells(8, 5) = Cells(8, 2)
        
        End If
        
        If Target = Cells(8, 2) Then
        Cells(8, 3) = (Cells(8, 4) - Cells(8, 5)) + Cells(8, 2)
        
        End If
    End Sub
    As you can see, this only works for Row 8. I've attempted to convert this to a range of cells and use offsets but have been unsuccessful. Can anyone assist in making this work for Rows 8-11 in the attached sheet, where it only updates the specific row that the change was made on. If I could use named ranges, that would be ideal, but not essential.
    Attached Files Attached Files

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