+ Reply to Thread
Results 1 to 3 of 3

Filter/Copy based sheet name paste non adjacent columns

Hybrid View

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

    Filter/Copy based sheet name paste non adjacent columns

    Hi.

    My code get values (tabs name) in column B ("Master"), and copy based criteria in column B

    Tab -> Master
    ColA---ColB----ColC
    ------Report A------
    ------Report B------
    ------Report C------
    ------Report A------
    Copy columns to tabs ("Report A","Report B","Report C")...but....
    Columns in in master tab is diferrent position in ("Report A","Report B","Report C").

    I need copy columns("E:I") from "Master" to ("Report A","Report B","Report C"), in columns (A:B, D, G:H)
    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 mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Filter/Copy based sheet name paste non adjacent columns

    This should do it

    Sub CopyToColWrong()
        Dim bottomD As Integer
        bottomD = Worksheets("Master").Range("A" & Rows.Count).End(xlUp).Row
        Dim c As Range
        For Each c In Worksheets("Master").Range("B2:B" & bottomD)
            Worksheets(c.Value).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Resize(, 8) = _
            Array(c.Offset(, 3).Value, c.Offset(, 4).Value, Empty, c.Offset(, 5).Value, Empty, Empty, c.Offset(, 6).Value, c.Offset(, 7).Value)
        Next c
    End Sub
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

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

    Re: Filter/Copy based sheet name paste non adjacent columns

    Hi Mike, you're geate!

    thank you very much!!!!

+ 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 and paste columns to another sheet based on a criteria
    By saya_26 in forum Excel General
    Replies: 17
    Last Post: 02-24-2014, 12:23 PM
  2. [SOLVED] Range Selection up to last visible adjacent cell,filter,copy paste to next sheet
    By kcube17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2013, 07:08 AM
  3. Macro to filter based on column heading then copy and paste to new sheet
    By macattackr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2012, 05:14 PM
  4. Filter, copy specific columns, and paste to another sheet as VALUES ONLY
    By elobelix in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2010, 11:59 AM
  5. Filter, copy specific columns, and paste to another sheet.
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-29-2009, 06:33 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