+ Reply to Thread
Results 1 to 8 of 8

Using a macro to copy and paste lists of data from one sheet to another

  1. #1
    Registered User
    Join Date
    06-27-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Cool Using a macro to copy and paste lists of data from one sheet to another

    I am a new member and This is my first post WHO-HOO!!! had to get that out of the way. Now back to business I am fairly new to excel. I am trying to develop a macro that will grab data from one sheet and paste it to another sheet by clicking the entry in a combo box. I was partially successful with actualy getting the data from one sheet to another by developing a macro for each field and linking the field name to a field in the combo box. However, I want the macro to neatly place the data side by side.

    Im not really Familiar with loops and If then else statements. But here is my thought process.
    My thought process is
    1)have a cell to put the first data in
    2)check to see if any data is in the first row
    3)check the next 9 rows to see if any data is in it
    3a)If not then Paste the copied contents
    3b) if it is then go to the first row of the next column and repeat step 3

    Here is the code for the entries
    Every time i try and run it i get a compile error
    I think its because of my loops but im not sure

    Please Login or Register  to view this content.

    I uploaded the document because I know I probly did not do a good job explaining it. I labeled every thing in the comments as well

    I need help...... when ever i get an error code it makes me sad
    and I dont like to be sad. Thanks in advance for any help.

    Johnnieboi

    Last edited by johnnieboi89; 07-05-2011 at 02:26 PM. Reason: Solved

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Using a macro to copy and paste lists of data from one sheet to another

    johnnieboi89,

    Welcome to the forum. Give this a try instead:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Using a macro to copy and paste lists of data from one sheet to another

    Maybe?

    Please Login or Register  to view this content.
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  4. #4
    Registered User
    Join Date
    06-27-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using a macro to copy and paste lists of data from one sheet to another

    Wow replies come back fast on here and it worked to perfection. Thanks so much
    However, I do have another question in my document I only had 4 different field names which is a fraction of the whole document how do you suggest I go about handling over a ton of fields. Like somewhere around 1000 or so

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Using a macro to copy and paste lists of data from one sheet to another

    johnnieboi89,

    The macro I provided will already automatically adjust for more field names and rows per field. No changes necessary.

    ~tigeravatar

  6. #6
    Registered User
    Join Date
    06-27-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using a macro to copy and paste lists of data from one sheet to another

    here is tha actual document. It may be a little different because the Source data comes from multiple pages. Thanks in advance
    johnnieboi

    Attached Files Attached Files

  7. #7
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Using a macro to copy and paste lists of data from one sheet to another

    johnnieboi89,

    Updated code:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  8. #8
    Registered User
    Join Date
    06-27-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using a macro to copy and paste lists of data from one sheet to another

    I tried your code and it didnt work for this document. I also changed the name of the sheet to the one specific for this document and i stI got a subscript out of Range error
    here is the code as i had to modify it

    Please Login or Register  to view this content.
    Thanks again
    Johnnieboi

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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