+ Reply to Thread
Results 1 to 1 of 1

macro to either add or update information based on test value

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    California
    MS-Off Ver
    Excel 97
    Posts
    1

    macro to either add or update information based on test value

    Hi all, brand new on the forum, relatively new to VBA, been using this forum as a resource for a while, but I finally have a problem that I can't solve with existing information.

    Ok, so basically I have a workbook which tracks employee evaluation data- there is a specific number of evaluations (12) that this workbook will track. What I want to be able to do, is take the data from the "master" log if you will, which is basically a list of all the evaluations from all employees, and move them to another worksheet where either a new row is created or the existing row is updated with another evaluation.

    Right now, I only have it set up to copy the name from column Y in the "log" worksheet into the "overview" worksheet, as well as the date. there are several other pieces of information I want to transfer, however I'm just trying to test the code with this data.

    I have attached a copy of the work book, and here is the code itself, which I just cant figure out how to work, but I feel like I might be close. :

    Sub UpdateOverview()

    Dim overView As Worksheet
    Dim inputLog As Worksheet

    Set inputLog = Worksheets("LOG")
    Set overView = Worksheets("OVERVIEW")

    Dim nextRow As Long
    Dim loadRow
    Dim placeRow
    Dim myCopy As String
    Dim nameRow


    loadRow = 2
    placeRow = 2
    nameRow = 2


    Do While loadRow < 500

    nameCheck = inputLog.Range("Y" & nameRow)
    nextRow = overView.Cells(placeRow, "A").End(xlUp).Offset(1, 0).Row


    If overView.Range("A" & placeRow) = nameCheck Then

    overView.Range("B" & placeRow) = inputLog.Range("E" & nameRow)

    nameRow = nameRow + 1

    placeRow = placeRow + 1


    Else

    overView.Range("A" & placeRow) = inputLog.Range("Y" & loadRow)

    placeRow = placeRow + 1



    End If



    loadRow = loadRow + 1

    Loop




    End Sub
    Thanks in advance for your help, and please let me know if you need any more information
    Attached Files Attached Files

+ 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