+ Reply to Thread
Results 1 to 7 of 7

Macro to add data to master

  1. #1
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Macro to add data to master

    I've browsed this site a couple times to search for problems/solutions I am experiencing. This time, i am stuck and cannot make it just the way I want. I consider myself to be proficient with excel, but am definitely an amateur in visual basic programming.

    On one workbook I have 3 sheets, "addrole", "masterlist" and "lists" (last sheet used for validation tables). I am adding data to the "addrole" sheet using columns A through L. The data can be 1 row, or it can be 10. The "masterlist" sheet has identical columns. It works, but I cannot stop it from pulling in the header (Row 1) from the "addrole" sheet into the "masterlist" and the master list ends up looking like i.e. - Row 1: header; Row 2: data; (run macro); Row 3: header (from addrole sheet); Row 4: data (from addrole sheet).

    I've tried changing the range, and offsets, but I just don't know vba well enough. I am thinking it might be one of the dim functions that I might need to change. I would REALLY appreciate the help as I've been working on this on/off for a week trying all differet things.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to add data to master

    It will be good if you attach the workbook as well so we can test the code. It will be time consuming for us to duplicate your workbook based on your explanation / code.

  3. #3
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to add data to master

    Quote Originally Posted by arlu1201 View Post
    It will be good if you attach the workbook as well so we can test the code. It will be time consuming for us to duplicate your workbook based on your explanation / code.
    Here is the spreadsheet with the real data pulled out. Let me know if you have any questions. I've assigned the macro to buttons, and "update" is the only macro I am concerned with.
    Attached Files Attached Files

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to add data to master

    So if i understand your question right, you want data from the Master sheet to get "Copied" to the Addrole sheet, right? Also, what if yesterday you copied 3 rows from the Master sheet and again today, you need to copy? Should the macro automatically identify which rows have been copied and only copy the ones that haven't? Or should the macro clear the Addrole sheet and then copy?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  5. #5
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to add data to master

    Quote Originally Posted by arlu1201 View Post
    So if i understand your question right, you want data from the Master sheet to get "Copied" to the Addrole sheet, right? Also, what if yesterday you copied 3 rows from the Master sheet and again today, you need to copy? Should the macro automatically identify which rows have been copied and only copy the ones that haven't? Or should the macro clear the Addrole sheet and then copy?

    Arlette, thanks for your response and happy thanksgiving. Sorry for the delayed response, I was on vacation for the holidays.

    I need to copy rows from the Addrole sheet to the end of the Master sheet, starting at row 5 (addrole sheet) to the last row used (row 5 could also be the last row used). The code I provided will allow me to do this, but it copies the header from the addrole sheet. I just need to have it copy rows used below the header from the addrole sheet, and paste them to the end of the master sheet. Any help you can provide would be very appreciated.

  6. #6
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to add data to master

    Anything ?

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to add data to master

    The code you need to copy is this -
    Please Login or Register  to view this content.
    I was looking through your code and you don't require this -
    Please Login or Register  to view this content.
    Also, is there any reason why you are finding x in the Masterlist? You mentioned that you only want the data to be copied at the end of the Masterlist tab, and so i provided the code above.

+ 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