+ Reply to Thread
Results 1 to 6 of 6

Paste in Different Worksheet, and is there a better method?

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Minnesota
    MS-Off Ver
    Office 365
    Posts
    163

    Paste in Different Worksheet, and is there a better method?

    Two Questions

    I have data in columns A through M on worksheet "DATA", with the data in columns C and D being either YES or NO. What I'd like to happen is if there is a YES in either column C or D, I want it copy all columns in that row and paste it on the next available line on the next worksheet called "Past Due Report".

    What has me stumped is how to get it to paste in the next available line on the Past Due Report sheet. I can get it to paste in a specific line, but I want it to paste in the next available line. So it might be row 100 on the "DATA" sheet, but row 25 on the "Past Due Report" sheet for example.

    Would someone please show me how to do this?

    Second question:

    I planned to do this by

    Please Login or Register  to view this content.
    with the active cell being in Column C and moving down after every check. My sheet typically has a couple thousand rows that it'd be checking. Is there a better way to do this, or is the if code the best?
    Last edited by OpieWinston; 07-30-2017 at 11:47 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Paste in Different Worksheet, and is there a better method?

    1. Use this formula:-

    Please Login or Register  to view this content.
    The 3 tells the macro to find the last used cell in column 3 and add 1

    2. Your Solution will require 2000 cells to be checked so probably very Slow.

    The fastest solution would probably be to use a helper column with the formula

    Please Login or Register  to view this content.
    So you can use something like this:-

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 07-30-2017 at 06:21 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,016

    Re: Paste in Different Worksheet, and is there a better method?

    Here’s another way:
    I assumed:
    -Data start at row 2
    -Last column is col E, you may change this.

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,016

    Re: Paste in Different Worksheet, and is there a better method?

    Sorry, I just realized that I misunderstood the requirement. I thought: if C = “YES” AND D = “YES”.
    So, don’t bother with the above code, it won’t work.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,558

    Re: Paste in Different Worksheet, and is there a better method?

    Another possibility maybe
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Minnesota
    MS-Off Ver
    Office 365
    Posts
    163

    Re: Paste in Different Worksheet, and is there a better method?

    I've not tried these yet, but will tomorrow, and assume that one of them will work for my needs. Thank you folks!

+ 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. Paste Method of Worksheet Class Failed
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-18-2012, 10:41 AM
  2. paste method of worksheet class failed
    By morevijay1982 in forum Excel General
    Replies: 7
    Last Post: 07-16-2012, 05:35 AM
  3. Paste Method of Worksheet Class Failed
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2011, 03:57 PM
  4. paste method of worksheet failed
    By Theodjinn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2008, 07:36 AM
  5. Paste method of worksheet class failed
    By Hobnob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2007, 08:03 AM
  6. Paste method of worksheet class failed
    By Maxi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2006, 12:35 PM
  7. Paste method of worksheet class failed
    By Maxi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2006, 11:40 AM
  8. Paste method of worksheet class failed
    By kavisara in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2005, 01:44 PM

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