+ Reply to Thread
Results 1 to 8 of 8

VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    Wanganui New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    23

    VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Hi

    Can someone give me a simple code to copy all data on sheet1 and paste it to sheet5 using command button

    Angela

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    Wanganui New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Hi

    I have put this code in but it doesn't work with my command button, am I missing something

    error saying expected end sub

    Angela

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Angela ,
    Have you created a command button? Which one did you use? Is it "Form Control" or Active control"?.
    You need to attach the code to a button if it the button is created using "Form". If it active control, all you have to do is
    change this line

    Please Login or Register  to view this content.
    with your active control button
    Last edited by AB33; 10-10-2013 at 04:40 AM.

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    Wanganui New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Thanks it works perfectly

    Angela

  6. #6
    Registered User
    Join Date
    07-31-2013
    Location
    Wanganui New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Hi
    Can you help me a little more I want to copy a second sheet onto Sheet 2 but when I do that it removes the first sheets data. Is there an extra bit of code to tell it to go to the first free line

    Angela

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    If you are copying in to next empty row in column A

    Please Login or Register  to view this content.
    What the code is saying to is: Copy all cells in sheet1 in to the next empty row in column A of sheet 5. You should do the same with the other sheet.
    If it is not working, please attach a sample.

  8. #8
    Registered User
    Join Date
    07-31-2013
    Location
    Wanganui New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button

    Thanks this worked

    Angela

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Simple Copy and Paste Command Button
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-25-2013, 02:38 PM
  2. Copy Data to a New Sheet if criteria match (multiple) using a Command Button
    By bambobeee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-03-2013, 12:37 AM
  3. Copy sheet and command button along with code to new workbook
    By sglavan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2012, 10:18 AM
  4. copy and paste data from one worksheet cell to another using command button
    By jasonruiz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2011, 04:34 AM
  5. Copy/paste-button - wrong reference code in sheet 2
    By Krapter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2009, 05:17 AM

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