+ Reply to Thread
Results 1 to 11 of 11

copy Tabs, based on two criteria in column J and paste values

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    copy Tabs, based on two criteria in column J and paste values

    Hi.
    the code below works, but for what I need two things missing.

    1º Copy all data from all tabs but only if it is equal to 1 or 2 in column J

    2º Copy and paste values
    Please Login or Register  to view this content.
    Cross-Post
    http://www.thecodecage.com/forumz/mi...te-values.html

    Thanks
    Attached Files Attached Files
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: copy Tabs, based on two criteria in column J and paste values

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    Re: copy Tabs, based on two criteria in column J and paste values

    What Tabs are you referring to ?

    And You want to copy it where?

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: copy Tabs, based on two criteria in column J and paste values

    Hi.JOHN H. DAVIS
    showed error
    Run-time error '13 run '

    incompatible types
    this line that turned yellow
    Please Login or Register  to view this content.
    Thank you!!!

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

    Re: copy Tabs, based on two criteria in column J and paste values

    You do not have a sheet named destination and I am not sure if the 3rd is meant to be destination sheet.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: copy Tabs, based on two criteria in column J and paste values

    I like it!!!!!!!

    Thank you very much!!!!!!!!!!!!!!!!!!

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: copy Tabs, based on two criteria in column J and paste values

    I can't seem to work with this file sample. I don't know why? What suggestions did you get from the Code Cage? I'm guessing it may be close what I would offer. But I tried everything I know, my machine/application refuses to cooperate.

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

    Re: copy Tabs, based on two criteria in column J and paste values

    John,
    If the error IS on this line.
    As far as I know, you can not assign multiple range to a value, but you can the other way round.

    Please Login or Register  to view this content.
    In other words, you can assign the values 1 and 2 to more than cells, but it errors when you evaluate a range.
    You need to loop through each cell and test it. That is from my expereince

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: copy Tabs, based on two criteria in column J and paste values

    Thanks for the insite AB33. But I tried several ways with the sample (including looping), and I couldn't get it to do anything other than filter the data.

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

    Re: copy Tabs, based on two criteria in column J and paste values

    John,
    I used a loop (With out the fancy with statement and seems to work, please check the attached.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: copy Tabs, based on two criteria in column J and paste values

    @AB33. You're right works perfectly.

+ 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] Copy/Paste a column in a new sheet based on a criteria
    By Elorac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2013, 02:01 PM
  2. [SOLVED] copy and paste rows based on criteria in column
    By CharlieZangel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2013, 12:54 PM
  3. [SOLVED] Copy, Paste and Delete Row based on column criteria
    By Kadover in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-17-2012, 11:54 AM
  4. [SOLVED] Macro to Copy Data and Paste Values Based on cell criteria
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 06:51 PM
  5. copy and paste values based on a criteria
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 11-15-2008, 11:35 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