Results 1 to 11 of 11

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

Threaded View

  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
    Public Sub Marreco() 
        Dim ws  As Worksheet, _ 
        LR1 As Long, _ 
        LR2 As Long 
         'Dest As Range
         'Set Dest = Sheets("Destination").Range("A" & LR1)
        Application.ScreenUpdating = False 
        For Each ws In ActiveWorkbook.Worksheets 
            If ws.Name <> "Destination" Then 
                LR1 = Sheets("Destination").Range("A" & Rows.Count).End(xlUp).Row + 1 
                LR2 = ws.Range("J" & Rows.Count).End(xlUp).Row 
                ws.Range("A11:J" & LR2).Copy Destination:=Sheets("Destination").Range("A" & LR1) 
                 'ws.Range("A11:J" & LR2).Copy
                 'Dest.PasteSpecial xlPasteValues
            End If 
        Next ws 
        Application.ScreenUpdating = True 
    End Sub
    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.

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