+ Reply to Thread
Results 1 to 4 of 4

How to copy and paste data from one tab to another tab with Macros?

  1. #1
    Registered User
    Join Date
    07-20-2012
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    3

    How to copy and paste data from one tab to another tab with Macros?

    Hi excel experts,

    I am trying create an Inventory Label Program that can copy and paste data from one Tab to another base on the number of rows that the user enter. For example if the user enter 5 on the "Labels To Be Displayed" tab of Nike Short row, then the program will go to Nike short tab and Copy Column A2,B2,C2,D2,E2,F2 and fill it to A2:F2 and 6 rows down in "Display Result" Tab. So basically it copy A2:F2 from second row and then fill it to A2:F2 6 rows down. If the users enter 3 in Nike T-shirt rows then it will copy A2:F2 from second row and then fill it to A2:F2 4 rows down.
    Could anyone please suggest what I should do? Or maybe help me write a short macros example?

    Thank you,

    Peter
    Attached Files Attached Files
    Last edited by simplyfocus; 07-30-2012 at 02:55 PM. Reason: Submit wrong file

  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: How to copy and paste data from one tab to another tab with Macros?

    What about the price column in the Nike Shorts tab? All columns have the same info except the price column. So when the autofill happens, should it just take 1 row and make copies of it (so the price remains the same) ? Or should it copy the current row + no of rows user asked for? So if user asks for 3, it will copy the current row + 3 rows (so price changes) ?
    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]

  3. #3
    Registered User
    Join Date
    07-20-2012
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to copy and paste data from one tab to another tab with Macros?

    Arlette,

    Thank you so much for your quick response. I re-uploaded the file. Assuming the prices are the same. Basically the number that the user enter is how many rows "Nike T-shirt Nike Blue W888901 W88901 $110 " the result tab should display. I then use this result tab to print out label. Instead of copy and paste 50 rows down. the user can just enter 50 in the "Number of Labels To Be Displayed" tab. I will have 50 rows of labels on the "Display Result" tab. But I am not sure what to use to run this function.

    Thank you so much for your help.

    Peter

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: How to copy and paste data from one tab to another tab with Macros?

    Hello there attached is your worksheet updated to include a command button and macro that runs that I believe achieves your results.

    Let me know if this works for you!

    Thanks!
    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