Copy Data From Current Worksheet To Range On Other Worksheet

  • Hi,


    I’m new to this site and especially to coding in VBA. I can do simple macros but am trying to write one for the following. I have 2 worksheets:
    Summary, which has the button I’m trying to write the vba for
    Data, which stores all of the data (like a database)


    When “Enter Data” is hit, I would like the 7 cells to the right of the button to be filled into the right spot, based on an ID number, on the Data sheet by inserting a row. I am trying to write an application that will find the ID number on the Data sheet, find the right block of data (I’m trying to use a pointer for this), and then fill in the information. I would like the Data sheet to only keep the five most recent entries and sort in descending order. I don’t quite know how to find the right block of code (this is why I’m trying to use pointers) and once found, how to insert a row in the right spot


    I’ve included my mismash of code below and a sample sheet (in 2 files as the file was too large together). Any advice would greatly be appreciated. Thank you!

  • Re: Copy Data From Current Worksheet To Range On Other Worksheet


    hi slakhani,


    May I suggest a simpler way?


    Use one workbook with two worksheets, then all you need use is Vlookup - should take only a few minutes to set up and no macros required.


    Cheers,


    GB

    But I always say luck is where preparation meets opportunity (Justin Langer 23/11/01)

  • Re: Copy Data From Current Worksheet To Range On Other Worksheet


    Hi GB,


    Thank you for your reply. I do have one workbook (the file was too large for me to post as one so I had to separate it). I will definetely try the VLOOKUP.


    Thanks again!


    S

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!