+ Reply to Thread
Results 1 to 4 of 4

Multiple sheet copy paste with sheet clear

  1. #1
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Exclamation Multiple sheet copy paste with sheet clear

    Hi everyone,

    I have three sheets in my workbook. I am trying to clear the first sheet then copy and paste everything from the 2nd and 3rd sheet into the first one.

    Right now the code is clearing the first sheet and copy everything from the 3rd sheet over to the 1st one but not the 2nd sheet.

    Any thoughts on how to fix this?

    Thank you in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Multiple sheet copy paste with sheet clear

    Please Login or Register  to view this content.
    Sheet3 is pasting over Sheet2.
    Delete the line in red. That is resetting the row counter for sheet 3.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Multiple sheet copy paste with sheet clear

    It worked, Thank you so much!!!!!

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Multiple sheet copy paste with sheet clear

    Quote Originally Posted by Rachel5694 View Post
    Please Login or Register  to view this content.
    Don't use "Clear" as the macro name (variable name, etc.), because this is the name of the method in vba.

    ps.: You can shorten your macro, e.g. in this way:
    Please Login or Register  to view this content.

+ 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. Copy multiple range form one sheet and paste them other sheet
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2017, 04:07 AM
  2. [SOLVED] Using command button to copy cell contents and paste to different sheet, then clear cells
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2015, 10:20 AM
  3. [SOLVED] Copy paste data one to multiple sheet based on cell value to sheet name
    By kannan1847 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2015, 12:54 AM
  4. [SOLVED] Clear Content in one sheet and copy & paste value from another sheet
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2013, 11:23 AM
  5. Replies: 18
    Last Post: 02-10-2013, 05:32 PM
  6. [SOLVED] Auto Copy / Paste from One Sheet to Multiple Sheet
    By ccowman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2013, 09:31 AM
  7. copy paste data with multiple selected ranges from sheet to sheet
    By sivdin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2011, 02:45 PM

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