+ Reply to Thread
Results 1 to 22 of 22

Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

Hybrid View

Jayant shettigar Copy columns from sheet 1 to... 07-21-2015, 08:24 AM
Parth007 Re: Copy columns from sheet 1... 07-21-2015, 09:30 AM
Jacc Re: Copy columns from sheet 1... 07-21-2015, 10:09 AM
Doc.AElstein Re: Copy columns from sheet 1... 07-21-2015, 11:45 AM
Jacc Re: Copy columns from sheet 1... 07-21-2015, 12:03 PM
Doc.AElstein Re: Copy columns from sheet 1... 07-21-2015, 12:12 PM
Doc.AElstein Re: Copy columns from sheet 1... 07-21-2015, 12:34 PM
apo Re: Copy columns from sheet 1... 07-21-2015, 01:00 PM
Doc.AElstein Re: Copy columns from sheet 1... 07-21-2015, 05:35 PM
Marc L Hi ! Try this demonstration ! 07-21-2015, 01:07 PM
Jacc Re: Copy columns from sheet 1... 07-21-2015, 02:00 PM
Marc L Re: Copy columns from sheet 1... 07-21-2015, 02:04 PM
Doc.AElstein Re: Copy columns from sheet 1... 07-21-2015, 04:37 PM
Jacc Re: Copy columns from sheet 1... 07-21-2015, 02:09 PM
Jacc Re: Copy columns from sheet 1... 07-21-2015, 02:15 PM
Doc.AElstein Re: Copy columns from sheet 1... 07-21-2015, 04:36 PM
apo Re: Copy columns from sheet 1... 07-21-2015, 06:54 PM
Jacc Re: Copy columns from sheet 1... 07-21-2015, 07:06 PM
Jayant shettigar Re: Copy columns from sheet 1... 07-22-2015, 04:07 AM
Doc.AElstein Re: Copy columns from sheet 1... 07-22-2015, 01:13 PM
Doc.AElstein Re: Copy columns from sheet 1... 07-22-2015, 01:40 PM
Jacc Re: Copy columns from sheet 1... 07-22-2015, 05:34 AM
  1. #1
    Registered User
    Join Date
    07-30-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2019
    Posts
    48

    Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Hi

    I have two sheets in the attached file , the first sheet Dump and the second sheet is Output
    Data in the dump sheet is in raw format , only certain columns are needed in the Output sheet from the dump sheet

    I have tried writing a code to extract the desired columns from the Dump sheet , to the Output sheet , but the code doesn't seem to work

    Can some one modify the code so that it extracts the way I have pasted the solution in Output sheet , also can the output be made dynamic to extract the column based on the column heading ?


    Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Hi Jayant,

    In Below code you can add the column names accordingly & make it in use... this will work Header wise
    This code is only for 5 columns till Debit...

    Something like this can be shorten & used

    
    
    Option Compare Text ' this line code remove the diffrence between Date and date
    Sub heading()
    Dim Lastrow As Long
    
    With Worksheets("Output")
    Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    End With
    
    Sheets("Output").Activate   'to clear sheet2 "A" column
    Range("A3:A" & Lastrow).ClearContents
    
    
    Sheets("Dump").Activate
    Cells(1, Columns.Count).End(xlToLeft).Select
    Range(ActiveCell, Range("A2")).Select
    
    
    For Each cell In Selection
    If cell.Value = "DOCUMENT_SOURCE" Then
    cell.EntireColumn.Copy
    Sheets("Output").Activate
    Range("A1").Select
    ActiveSheet.Paste
    End If
    Next cell
    
    Application.CutCopyMode = False
    End Sub
    
    
    Sub heading1()
    Dim Lastrow As Long
    
    With Worksheets("Output")
    Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    End With
    
    Sheets("Output").Activate   'to clear sheet2 "A" column
    Range("B3:B" & Lastrow).ClearContents
    
    
    Sheets("Dump").Activate
    Cells(1, Columns.Count).End(xlToLeft).Select
    Range(ActiveCell, Range("F2")).Select
    
    
    For Each cell In Selection
    If cell.Value = "SOURCE_DOCUMENT_DATE" Then
    cell.EntireColumn.Copy
    Sheets("Output").Activate
    Range("B1").Select
    ActiveSheet.Paste
    End If
    Next cell
    
    Application.CutCopyMode = False
    End Sub
    
    Sub heading2()
    Dim Lastrow As Long
    
    With Worksheets("Output")
    Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    End With
    
    Sheets("Output").Activate   'to clear sheet2 "A" column
    Range("C3:C" & Lastrow).ClearContents
    
    
    Sheets("Dump").Activate
    Cells(1, Columns.Count).End(xlToLeft).Select
    Range(ActiveCell, Range("D2")).Select
    
    
    For Each cell In Selection
    If cell.Value = "SOURCE_DOCUMENT_NUMBER" Then
    cell.EntireColumn.Copy
    Sheets("Output").Activate
    Range("C1").Select
    ActiveSheet.Paste
    End If
    Next cell
    
    Application.CutCopyMode = False
    End Sub
    
    Sub heading3()
    Dim Lastrow As Long
    
    With Worksheets("Output")
    Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    End With
    
    Sheets("Output").Activate   'to clear sheet2 "A" column
    Range("D3:D" & Lastrow).ClearContents
    
    
    Sheets("Dump").Activate
    Cells(1, Columns.Count).End(xlToLeft).Select
    Range(ActiveCell, Range("M2")).Select
    
    
    For Each cell In Selection
    If cell.Value = "EVENT_TYPE" Then
    cell.EntireColumn.Copy
    Sheets("Output").Activate
    Range("D1").Select
    ActiveSheet.Paste
    End If
    Next cell
    
    Application.CutCopyMode = False
    End Sub
    
    
    Sub heading4()
    Dim Lastrow As Long
    
    With Worksheets("Output")
    Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    End With
    
    Sheets("Output").Activate   'to clear sheet2 "A" column
    Range("E3:E" & Lastrow).ClearContents
    
    
    Sheets("Dump").Activate
    Cells(1, Columns.Count).End(xlToLeft).Select
    Range(ActiveCell, Range("AI2")).Select
    
    
    For Each cell In Selection
    If cell.Value = "Debit" Then
    cell.EntireColumn.Copy
    Sheets("Output").Activate
    Range("E1").Select
    ActiveSheet.Paste
    End If
    Next cell
    
    Application.CutCopyMode = False
    End Sub
    
    
    
    Sub heading4()
    Dim Lastrow As Long
    
    With Worksheets("Output")
    Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    End With
    
    Sheets("Output").Activate   'to clear sheet2 "A" column
    Range("E3:E" & Lastrow).ClearContents
    
    
    Sheets("Dump").Activate
    Cells(1, Columns.Count).End(xlToLeft).Select
    Range(ActiveCell, Range("AI2")).Select
    
    
    For Each cell In Selection
    If cell.Value = "Debit" Then
    cell.EntireColumn.Copy
    Sheets("Output").Activate
    Range("E1").Select
    ActiveSheet.Paste
    End If
    Next cell
    
    Application.CutCopyMode = False
    End Sub
    Last edited by Parth007; 07-21-2015 at 09:39 AM.
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    The macro recorder will give you the code for the Copy Paste but that is NOT what you should use.
    I fixed your code so that it runs, changed names of sheets, not tab name but object name, and a couple of other things but it takes something like 150 seconds to run.

    I also wrote a new piece of code looking like below and it takes less then 0.1 seconds to run. This huge time difference is why you should not use Copy Paste in VBA.
    I assume this code can be made more compact and faster running by people who are good at VBA but this was the best I could do.

    Option Explicit
    Sub copycolumns_Jacc()
    Dim LrDump As Long
    Dim LrOutput As Long
    Dim i As Long
    Dim t As Single
    
    t = Timer
    Application.ScreenUpdating = False
    LrDump = Dump.Cells(Rows.Count, 1).End(xlUp).Row
    
    
        Intersect(Output.Cells.Columns(1), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(1), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(2), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(6), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(3), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(4), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(4), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(13), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(5), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(35), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(6), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(36), Dump.Cells.Rows("1:" & LrDump)).Value
        
        Intersect(Output.Cells.Columns(8), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(19), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(9), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(28), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(10), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(15), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(11), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(10), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(12), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(11), Dump.Cells.Rows("1:" & LrDump)).Value
    
    Output.Columns.AutoFit
    Output.Activate
    Output.Range("A1").Select
    
    Application.ScreenUpdating = True
    t = Timer - t
    MsgBox "It took " & t & "seconds"
    End Sub
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  4. #4
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Hi Jacc,
    . Nice Code.
    . ( I think you missed a small bit:

    Dim Dump As Worksheet, Output As Worksheet 'Give Abbreviation Methods, Properties of Object Worksheet through .dot
    Set Dump = ThisWorkbook.Worksheets("Dump"): Set Output = ThisWorkbook.Worksheets("Output")
    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Thanks Doc!
    My answer is yes and no. I should have written it as you suggest, I guess this is the proper thing to do.
    What I did was to change the programming name of the worksheet manually.
    You can do that by selecting a worksheet to the left in the Project Explorer in the VBA editor, then in the properties window below (hit F4 if it's not displayed) you can see the programming name (or object name) at the top and simply change it.

    Edit: I see now that the correct term is CodeName, not programming name or object name. You will find it in the Object Browser (F2 in the VBA editor).
    Last edited by Jacc; 07-21-2015 at 12:20 PM.

  6. #6
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Quote Originally Posted by Jacc View Post
    ...
    My answer is yes and no. ....
    Ahh , OK. Sorry. - I am a Beginner and I did not know that you could do that . I just tried that, and see that the extra code bit I gave is then not necerssary.
    . Useful Info, Thanks

    Alan

    .P.s. I was attempting a solution as you posted. I will finish it and post it later and include you speed tests for a comparison

  7. #7
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    @ Jayant shettigar
    Hi Jayant shettigar
    . I was working on a code for you as Jacc posted his great code..
    . As I had almost finished I thought I would still give my alternative.
    .
    . There are infinite ways to do your requirement, mine is based on a previous solution I gave here, ( where there are some more detailed explanations of what is going on. )
    http://www.mrexcel.com/forum/excel-q...l?#post4174322
    .
    . I give you two codes, basically the same, the first simplified, the second opened up and with explaining Green comments

    . I modified my first simplified code to include the Timer part from Jacc as a further comparison. ( And also to run it needs you to the make those changes to the programming names of the worksheet in manually as Jacc explained in Post #5 )
    . My codes are almost as fast as Jacc’s
    Codes:

    'Option Explicit'This must be commented out for simplified Code
    Sub CopyColumnsAlanSHimpfGlified()
    
    Dim arrin() As Variant: Let arrin() = Dump.Range("A2:AK" & Dump.Cells(Rows.Count, 1).End(xlUp).Row).Value
    Let arrin(1, 37) = "Cleared"
    
    t = Timer
    Application.ScreenUpdating = False
    
        Dim c() As Variant: Let c() = Array("1", "6", "4", "13", "35", "36", "37", "19", "28", "15", "2", "3"): Let c() = Application.WorksheetFunction.Transpose(c())
           For iii = LBound(arrin(), 1) To UBound(arrin(), 1)
               Let strRows = strRows & " " & iii
           Next iii
        Dim outArr() As Variant: outArr() = Application.WorksheetFunction.Transpose(Application.Index(arrin(), Split(Trim(strRows), " "), c()))
        
        Output.Range("A2").Resize(UBound(outArr(), 1), UBound(outArr(), 2)) = outArr()
    
    Application.ScreenUpdating = True
    t = Timer - t
    MsgBox "It took " & t & "seconds"
    End Sub
    '
    '
    '
    '
    '
    '
    '
    
    
    
    
    Sub CopyColumnsAlan()
    ' 1) Get Initial Data
    Dim wsDump As Worksheet, wsOut As Worksheet 'Give Abbreviation Methods, Properties of Object Worksheet through .dot
    Set wsDump = ThisWorkbook.Worksheets("Dump"): Set wsOut = ThisWorkbook.Worksheets("Output")
    Dim lr As Long, lc As Long 'Variable for, last Row, last Column of  sheet1. Assume our File for Input has a reasonably well defined end. Long is a Big whole Number limit (-2,147,483,648 to 2,147,483,647) If you need some sort of validation the value should only be within the range of a Byte/Integer otherwise there's no point using anything but Long.--upon/after 32-bit, Integers (Short) need converted internally anyways, so a Long is actually faster.
    Let lc = 36: Let lr = wsDump.Cells.Find(What:="*", After:=wsDump.Cells(1, 1), Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row 'Get last Row with entry anywhere for Sheet1. Method: You start at first cell then go backwards (which effectively starts at end of sheet), searching for anything ( = * ) by rows, then get the row number. This allows for different excel versions with different available Row numbers) Just a different method that finds last row in sheet rather than row for last entry in particular cell. Better to use that here as we are not sure which columns are full
    Let lc = lc + 1 'Include an extra column, assume that column is empty
    Dim arrin() As Variant: Let arrin() = wsDump.Range(wsDump.Cells(2, 1), wsDump.Cells(lr, lc)).Value  'Allowed VBA One Liner - An Array of variants may be set to a collection of Range values. The Range object works as to return a collection of (Variants initially) of various types. So Initially must see an Array of Variant types for compatability
    Let arrin(1, lc) = "Cleared" 'Extra heading in last "Column" in Array
    
    
    ' 2) We could include a part here to make the output be made dynamic to extract the column based on the column heading
    ' -  this would involve an alternative way to get at c()
    
    ' 3 )obtain an Array of indicies for required output columns and all "row" indices from array arrin()
        Dim c() As Variant: Let c() = Array("1", "6", "4", "13", "35", "36", "" & lc & "", "19", "28", "15", "2", "3"): Let c() = Application.WorksheetFunction.Transpose(c())
        Dim iii As Long, strRows As String 'Loop Bound (Count) Variable and tempoary sting for row indicies
           For iii = LBound(arrin(), 1) To UBound(arrin(), 1) 'Lower Bound by me is header
               Let strRows = strRows & " " & iii 'Concatenating valid "row" indicies
           Next iii
            Let strRows = Trim(strRows) 'trim off first space
        Dim r() As String: Let r() = Split(strRows, " ")
        Dim outArr() As Variant 'I believe here the Index is working in some "vector" type form here. VBA "works" as follows here:
            Let outArr() = Application.Index(arrin(), r(), c()) 'It takes in turn each of the indicies in rws()
    '        'and for each of these it steps through the indicies in clms(). It returns then effectively a "column" of values.
    '        ' These values are then the entities in the main Array arrin() given by those co-ordinates. In our case then, we initially put into the new Array y(), a column which contains the first data row.
            Let outArr() = Application.WorksheetFunction.Transpose(outArr()) '...As this process is then repeated for all the indicies given in  rws() we effectively have an Array  y() of our required output rows , but transposed. ( so we transpose it back to the correct orientation! )
        
    ' 3 ) Output Array with required Columns, and Rows out to Output Sheet
        Let wsOut.Range("A2").Resize(UBound(outArr(), 1), UBound(outArr(), 2)) = outArr() 'Simple neat allowed VBA one liner to assign values in an Array to a spreadsheet Range: Resize top left of output range to size of outout array and make it = th that Array
    
    End Sub
    . Alan

  8. #8
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    HI..

    Here's another one...

    Not sure about speed.. it's 'my' Friday night here (and 2.56 am to boot).. had enough Rum to join the league of Pirates i reckon.. ahoy me matees.. in any case..

    Try this:

    Private Sub CommandButton1_Click()
        Dim x
        With [A1].CurrentRegion
            x = .Offset(1).Resize(.Rows.Count - 1, .Columns.Count + 1).Value
            Sheets("Sheet1").Cells(1).Resize(UBound(x), 12) = Application.Index(x, Evaluate("row(1:" & UBound(x) + 1 & ")"), Array(1, 6, 4, 13, 35, 36, 37, 19, 28, 15, 2, 3))
        End With
    End Sub
    The .Columns.Count+1 and then the '37' in the array is so i can reference a blank column 'outside' the real CurrentRegion.. hence allowing for the blank column in the output.

    Note: Check out snb's site for more good stuff..
    Attached Files Attached Files
    Last edited by apo; 07-21-2015 at 01:16 PM.

  9. #9
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Quote Originally Posted by apo View Post
    ........ Its (my) Saturday night here.. and 1:41 am also.. few Rums under my belt..so i will keep it short...ish (but reply further when time/less intoxication permits,
    ..)
    and
    Quote Originally Posted by apo View Post
    ........ it's 'my' Friday night here (and 2.56 am to boot).. had enough Rum to join the league of Pirates i reckon.. ahoy me matees.. in any case..
    ........)
    ….. ? “ Yo Ho Ho .. and a Bottle of Rum…….” What - every Day?
    ….
    Quote Originally Posted by Doc.AElstein View Post
    ...... I almost understand apo’s code - My code and apo’s are basically similar – stands to reason – These sort of codes I do are usually stolen from versions of his codes!!! ........……..
    …. Hey Guys, while He’s sleeping it off I will sneak around and steal some more of his codes – And while I am there I will see if I can find some documentation to help understand his code quicker….( still a bl--dy mystery to me exactly how the Application.Index works when it has Arrays as its second and third arguments... ( and why Application.WorksheetFunction.Index does not work...) ...)
    Alan
    Last edited by Doc.AElstein; 07-21-2015 at 06:08 PM.

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Hi ! Try this demonstration !


    With a trick, Excel basics are fast enough !

    PHP Code: 
    Sub Demo()
        
    With Sheet1.Cells(1).CurrentRegion.Rows
            With 
    .Item("2:" & .Count)
                
    Application.ScreenUpdating False
                
    .Cells(5).Copy Sheet2.[G2]
                .
    AdvancedFilter xlFilterCopy, , Sheet2.[A2:L2]
            
    End With
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  11. #11
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    I see the really good guys have arrived
    apo, I made a tiny change to your code. I also timed it, something like 10^-8 seconds, fast enough he he...

    Option Explicit
    Sub Click()
        Dim x
        With [A1].CurrentRegion
            x = .Offset(1).Resize(.Rows.Count - 1, .Columns.Count + 1).Value
            Sheets("Sheet1").Cells(2, 1).Resize(UBound(x), 12) = Application.Index(x, Evaluate("row(1:" & UBound(x) + 1 & ")"), Array(1, 6, 4, 13, 35, 36, 37, 19, 28, 15, 2, 3))
        End With
    End Sub

    Good looking piece of code there Marc L, very compact. However it takes about 0.6 seconds on my pc, about ten times slower than my code. Also I think you missed the empty column.
    Last edited by Jacc; 07-21-2015 at 02:02 PM.

  12. #12
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA


    The trick is to use a source column and clear it in destination …

    But the column is already empty ! Just have to rename its title …

    Apo's way is the coolest !
    Last edited by Marc L; 07-21-2015 at 02:09 PM.

  13. #13
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Codes for last speed tests in post #14

    Sub CaptnApo()
    'The .Columns.Count+1 and then the '37' in the array is so i can reference a blank column 'outside' the real CurrentRegion.. hence allowing for the blank column in the output.
    Dim wsDump As Worksheet, wsOut As Worksheet 'Give Abbreviation Methods, Properties of Object Worksheet through .dot
    Set wsDump = ThisWorkbook.Worksheets("Dump"): Set wsOut = ThisWorkbook.Worksheets("Output")
    
        Dim x
        With wsDump.Range("A1").CurrentRegion
            x = .Offset(1).Resize(.Rows.Count - 1, .Columns.Count + 1).Value 'ArrayIn from Row 2 * 1 column
            wsOut.Cells(2, 1).Resize(UBound(x), 12) = Application.Index(x, Evaluate("row(1:" & UBound(x) + 1 & ")"), Array(1, 6, 4, 13, 35, 36, 37, 19, 28, 15, 2, 3))
        End With
    
    End Sub
    
    
    
    
    
    'Option Explicit'This must be commented out for simplified Code
    Sub CopyColumnsAlanSHimpfGlified()
    
    Dim arrin() As Variant: Let arrin() = Dump.Range("A2:AK" & Dump.Cells(Rows.Count, 1).End(xlUp).Row).Value
    Let arrin(1, 37) = "Cleared"
    
    
        Dim c() As Variant: Let c() = Array("1", "6", "4", "13", "35", "36", "37", "19", "28", "15", "2", "3"): Let c() = Application.WorksheetFunction.Transpose(c())
           For iii = LBound(arrin(), 1) To UBound(arrin(), 1)
               Let strRows = strRows & " " & iii
           Next iii
        Dim outArr() As Variant: outArr() = Application.WorksheetFunction.Transpose(Application.Index(arrin(), Split(Trim(strRows), " "), c()))
        
        Output.Range("A2").Resize(UBound(outArr(), 1), UBound(outArr(), 2)) = outArr()
    
    End Sub
    '
    '
    '
    '
    '
    '
    '
    
    
    
    
    Sub CopyColumnsAlan()
    ' 1) Get Initial Data
    Dim wsDump As Worksheet, wsOut As Worksheet 'Give Abbreviation Methods, Properties of Object Worksheet through .dot
    Set wsDump = ThisWorkbook.Worksheets("Dump"): Set wsOut = ThisWorkbook.Worksheets("Output")
    Dim lr As Long, lc As Long 'Variable for, last Row, last Column of  sheet1. Assume our File for Input has a reasonably well defined end. Long is a Big whole Number limit (-2,147,483,648 to 2,147,483,647) If you need some sort of validation the value should only be within the range of a Byte/Integer otherwise there's no point using anything but Long.--upon/after 32-bit, Integers (Short) need converted internally anyways, so a Long is actually faster.
    Let lc = 36: Let lr = wsDump.Cells.Find(What:="*", After:=wsDump.Cells(1, 1), Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row 'Get last Row with entry anywhere for Sheet1. Method: You start at first cell then go backwards (which effectively starts at end of sheet), searching for anything ( = * ) by rows, then get the row number. This allows for different excel versions with different available Row numbers) Just a different method that finds last row in sheet rather than row for last entry in particular cell. Better to use that here as we are not sure which columns are full
    Let lc = lc + 1 'Include an extra column, assume that column is empty
    Dim arrin() As Variant: Let arrin() = wsDump.Range(wsDump.Cells(2, 1), wsDump.Cells(lr, lc)).Value  'Allowed VBA One Liner - An Array of variants may be set to a collection of Range values. The Range object works as to return a collection of (Variants initially) of various types. So Initially must see an Array of Variant types for compatability
    Let arrin(1, lc) = "Cleared" 'Extra heading in last "Column" in Array
    
    
    ' 2) We could include a part here to make the output be made dynamic to extract the column based on the column heading
    ' -  this would involve an alternative way to get at c()
    
    ' 3 )obtain an Array of indicies for required output columns and all "row" indices from array arrin()
        Dim c() As Variant: Let c() = Array("1", "6", "4", "13", "35", "36", "" & lc & "", "19", "28", "15", "2", "3"): Let c() = Application.WorksheetFunction.Transpose(c())
        Dim iii As Long, strRows As String 'Loop Bound (Count) Variable and tempoary sting for row indicies
           For iii = LBound(arrin(), 1) To UBound(arrin(), 1) 'Lower Bound by me is header
               Let strRows = strRows & " " & iii 'Concatenating valid "row" indicies
           Next iii
            Let strRows = Trim(strRows) 'trim off first space
        Dim r() As String: Let r() = Split(strRows, " ")
        Dim outArr() As Variant 'I believe here the Index is working in some "vector" type form here. VBA "works" as follows here:
            Let outArr() = Application.Index(arrin(), r(), c()) 'It takes in turn each of the indicies in rws()
    '        'and for each of these it steps through the indicies in clms(). It returns then effectively a "column" of values.
    '        ' These values are then the entities in the main Array arrin() given by those co-ordinates. In our case then, we initially put into the new Array y(), a column which contains the first data row.
            Let outArr() = Application.WorksheetFunction.Transpose(outArr()) '...As this process is then repeated for all the indicies given in  rws() we effectively have an Array  y() of our required output rows , but transposed. ( so we transpose it back to the correct orientation! )
        
    ' 3 ) Output Array with required Columns, and Rows out to Output Sheet
        Let wsOut.Range("A2").Resize(UBound(outArr(), 1), UBound(outArr(), 2)) = outArr() 'Simple neat allowed VBA one liner to assign values in an Array to a spreadsheet Range: Resize top left of output range to size of outout array and make it = th that Array
    
    End Sub
    
    
    Sub copycolumns_Jacc()
    Dim LrDump As Long
    Dim LrOutput As Long
    Dim i As Long
    
    ' The next two lines could be commented out: Jacc; What I did was to change the programming name of the worksheet manually.
        'You can do that by selecting a worksheet to the left in the Project Explorer in the VBA editor, then in the properties window below (hit F4 if it's not displayed) you can see the programming name (or object name) at the top and simply change it.
        Dim Dump As Worksheet, Output As Worksheet 'Give Abbreviation Methods, Properties of Object Worksheet through .dot
        Set Dump = ThisWorkbook.Worksheets("Dump"): Set Output = ThisWorkbook.Worksheets("Output")
    
    
    LrDump = Dump.Cells(Rows.Count, 1).End(xlUp).Row
    
    
        Intersect(Output.Cells.Columns(1), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(1), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(2), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(6), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(3), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(4), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(4), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(13), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(5), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(35), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(6), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(36), Dump.Cells.Rows("1:" & LrDump)).Value
        
        Intersect(Output.Cells.Columns(8), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(19), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(9), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(28), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(10), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(15), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(11), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(10), Dump.Cells.Rows("1:" & LrDump)).Value
        Intersect(Output.Cells.Columns(12), Output.Cells.Rows("1:" & LrDump)).Value = Intersect(Dump.Cells.Columns(11), Dump.Cells.Rows("1:" & LrDump)).Value
    
    Output.Columns.AutoFit
    Output.Activate
    Output.Range("A1").Select
    
    End Sub

  14. #14
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Doc, your code runs at about 0,15s on my pc, pretty good.

  15. #15
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Apo's code is very cool and crazy fast! At least one million times faster than the rest of us, can that be right? I'm not sure I trust this timer function for such low numbers.

  16. #16
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Quote Originally Posted by Jacc View Post
    Apo's code is very cool and crazy fast! At least one million times faster than the rest of us, can that be right? I'm not sure I trust this timer function for such low numbers.
    Hi Jacc,
    . I am going a bit over both my competence and the capabilities of my 10 year old worn out slow computer here probably:
    – I may have over looked something - you could probably do the following better:
    . Here are Some speed tests based on an old Thread of mine – see around post # 12 here:
    http://www.mrexcel.com/forum/excel-q...looping-2.html
    . Basically I am using both the VBA Timer and the Charley Williams Micro Timer, referenced in that Thread above, and pointed out to me by Jerry Sullivan..
    .. Here are my initial results for my old Note Book - ( ACER 4810TZG Vista XL 2007. )
    . But I should emphasize that in other Threads such as
    http://www.mrexcel.com/forum/excel-q...vlookup-9.html
    .. I have had very inconsistent results with different computers, XL versions , operating software etc. etc.

    Using Excel 2007
    VBA Timer Charley Williams Micro Timer
    Captain apo
    0.44
    0.44
    Alan SHmpfGlified
    0.54
    0.54
    Alan Full
    0.55
    0.55
    Jacc
    0.371
    0.371
    SpeedTests

    . I almost understand apo’s code - My code and apo’s are basically similar – stands to reason – These sort of codes I do are usually stolen from versions of his codes!!! Mine would be a bit slower because of unecerssary transposing - I just cannot get the hang of how the Application.Index works exactly with Arrays as it's second and third arguments )
    . Yours is new, and a nice alternative. I understand it now
    . I will look at Marc L’s later, but I am busting me Nuts just now trying to understand how or if that works - I have no idea yet!!


    . Here are the codes I am using for the speed tests:

    ' next 2 lines needed for 'Charley Williams Micro Timer Code
    Private Declare Function getFrequency Lib "kernel32" Alias "QueryPerformanceFrequency" (cyFrequency As Currency) As Long
    Private Declare Function getTickCount Lib "kernel32" Alias "QueryPerformanceCounter" (cyTickCount As Currency) As Long
    '
    Sub Timers() 'SubRoutine to call Timer Functions and Subroutines under test and display results.
     
    Dim StartMTTime As Single, StartVBATime As Single 'times inn seconds at start of a run
    Dim MTTime As Single, VBATime As Single 'Run times given from Timer Functions
    Let MTTime = 0 'Could leave this out, but good
    Let VBATime = 0 'Practice to put it in
    Dim Iteration As Long, MaxIteration As Long 'Variable used in avaraging a few runs
    Let MaxIteration = 10 'Set here the nimber of runs that you want.
        
        'First Run: timing is often longer first time so do first run without Timers
        Call CaptnApo 'First Run: timing is often longer first time so do first run without Timers
        'Call CopyColumnsAlanSHimpfGlified
        'Call CopyColumnsAlan
        'Call copycolumns_Jacc
        
        'Main Runs to obtain average times
          For Iteration = 1 To MaxIteration 'Run as many times as specified.
          Let StartMTTime = MicroTimer 'Function Code from Charley Williams
          Let StartVBATime = VBATimer 'Typical VBA Timer() Function code
        
        Application.ScreenUpdating = False
          Call CaptnApo
          'Call CopyColumnsAlanSHimpfGlified
          'Call CopyColumnsAlan
          'Call copycolumns_Jacc
        Application.ScreenUpdating = True
          Let MTTime = (MTTime + (MicroTimer - StartMTTime)) 'Total times so
          Let VBATime = (VBATime + (VBATimer - StartVBATime)) 'far.
          Next Iteration 'Go and do another run(s)
        MsgBox "Micro Timer " & (MTTime) / MaxIteration & " Seconds" & vbCr & _
               "VBA Timer " & (VBATime) / MaxIteration & " Seconds" 'Display avarage results.
    End Sub ' Timers()
    
    '
    
    
    Function VBATimer()
    'Typical VBA Timer Program
        VBATimer = Timer 'Timer is a VBA Function that gives current time in seconds
    End Function ' VBATimer()
    Function MicroTimer() As Single 'Charley Williams Micro Timer Code
     
        Dim cyTicks1 As Currency
        Static cyFrequency As Currency
        Let MicroTimer = 0
          If cyFrequency = 0 Then getFrequency cyFrequency ' get ticks/sec
          getTickCount cyTicks1 ' get ticks
          If cyFrequency Then MicroTimer = cyTicks1 / cyFrequency ' calc seconds
        
    End Function 'MicroTimer()
    '
    '
    '


    .. I will drop the 4 actual Sub codes I timed in next Post #15 because of the Thread size limitations at Excel Forum……..
    Last edited by Doc.AElstein; 07-21-2015 at 06:21 PM.

  17. #17
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Thanks.. but the real credit should go to snb for his work and sharing of that work found on his website..

    For example.. his section on Arrays is probably the most comprehensive I have seen.

    http://www.snb-vba.eu/VBA_Arrays_en.html

    “ Yo Ho Ho .. and a Bottle of Rum…….” What - every Day?
    oops.. that other quote about Rum must have been from another apo.. I swear.. can't have been me

  18. #18
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Those times you presented are very similar, that's not at all what I got. I'll look in to it tomorrow.

  19. #19
    Registered User
    Join Date
    07-30-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2019
    Posts
    48

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Thank you very much , I would like to thank each and everyone personally who contributed to this thread , you guys are all really great and are doing a wonderful service to naïve learners like us

    This has really simplified my work a lot , Thank you once again

  20. #20
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    Quote Originally Posted by Jayant shettigar View Post
    Thank you very much , I would like to thank each and everyone personally who contributed to this thread , you guys are all really great and are doing a wonderful service to naïve learners like us ....., Thank you once again
    You are welcome for my contribution. Thanks for the feedback.
    .........................
    . And a thanks from me to all the contributers who are doing a wonderful service to naïve nuts like me...
    . these sort of threads I really learn lots from.........
    ..... more on that shortly in my next post here.....

    . Alan

  21. #21
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA

    @apo….
    Hi,

    Quote Originally Posted by apo View Post
    …..

    oops.. that other quote about Rum must have been from another apo.. I swear.. can't have been me …..
    . apo, I have the evidence it was you. I may consider a threat to publish…. Let me see… what could be a good ransom…Hmm…. Maybe some explaining comments on your codes or explanation of what is going on with Application.Index with Array as second and Third Arguments… I mean how / why it actually “works” as it does.

    Quote Originally Posted by apo View Post
    Thanks.. but the real credit should go to snb ……
    For example.. his section on Arrays is probably the most comprehensive I have seen.
    …..Check out snb's site for more good stuff. …..
    . That is a good reference site, but I do not yet get a clear understanding of how the Index stuff is working. ( maybe I just did not stumble on that bit yet – it is a very good extensive and very comprehensive info source )
    . ( Shame I have nothing “on“ snb to get a ransom of an explanation. (- If he can: Most experts I have asked do not get past understanding why Application.WorksheetFunction.Index does not work as Application.Index does.. ) )
    ………………………………………………………………….
    . FWIW: ( And for my late reference if no-one else’s!! ), my explanation of what the Index does without understanding “how” or “why”
    .
    . If I have an Input Array ( say captured from a Spreadsheet range like wot we have been looking at )..

    . I have learnt from apo’s codes that there is a neat way to get an output Array built from a combination of “rows” and “columns” form that Input Array. This involves Using a Code line of the form (Psuedo code)
    ArrayOut = Index(ArrayIn, rws, clms)
    , where rws and clms are Arrays which contain the indices ( 1 2 6 8 etc. ) of the required “rows” and “columns” respectively..

    I now know two methods:
    The first method ( up until this Thread the only one I knew ) was:

    Method1:
    . 1a) rws is a 1 dimensional Array ( or 2 Dimensional Array of one “row” ) containing the require output “row” indices. clms is a 2 dimensional Array of 1 column containing the required output “column” indices
    . 1b) The above ( .1a) ) produces my required output Array except that the Array is Transposed , so I need to transpose this array to get my required results.

    Method2: ( Learnt from this Thread ).
    . 2) rws is a 2 Dimensional Array of 1 “column” containing the indices of the required output “rows”. clms is a 1 dimensional Array ( or 2 dimensional Array of one “row” ) containing the required output “columns”

    .. which method you use , is I guess based on the one needing the least steps in total – In apo’s last code the Evaluate bit is probably a good quick way to get the “row” indices when all ( or a continuous as in this case with the extra one tacked on the end ) of the “rows” are required. Hence Method 2) is appropriate and not method 1) as I had used!
    .
    …So……..

    @Jacc
    Quote Originally Posted by Jacc View Post
    Those times you presented are very similar, that's not at all what I got. I'll look in to it tomorrow.
    . My results are probably limited by my crapy old computers, or some other errors in my measurements. So I look forward to your results if you get a chance to look further at those codes, for example using the improved Charles Williams Timer.
    . To that end here is another code version. Basically the is code stolen from apo’s last code. I understand it at least enough now to use it ( I am still no further at understanding Marc L’s )
    . ( My final code is probably just a bit slower that apo’s as I have added a few steps to help me understand it. – By my test it takes the same amount of time as apo’s, but that may be down to my measurement errors or computer as mentioned )

    Code:

    '
    Sub CaptnApoAlan()
    'The .Columns.Count+1 in the array is to reference a blank column 'outside' the real CurrentRegion.. Hence allowing for the blank column in the output.
    Dim wsDump As Worksheet, wsOut As Worksheet 'Give Abbreviation Methods, Properties of Object Worksheet through .dot
    Set wsDump = ThisWorkbook.Worksheets("Dump"): Set wsOut = ThisWorkbook.Worksheets("Output")
    Dim rngIn As Range: Set rngIn = wsDump.Range("A1").CurrentRegion 'Range taken in from Dump sheet
        Dim arrin As Variant: Let arrin = rngIn.Offset(1).Resize(rngIn.Rows.Count - 1, rngIn.Columns.Count + 1).Value 'ArrayIn from Row 2 , column + 1 to allowing for the blank column in the output
        Dim rws() As Variant: Let rws() = Evaluate("row(1:" & UBound(arrin, 1) + 1 & ")") '2 Dimensional 1 Column Array
        Dim clms() As Variant: Let clms() = Array(1, 6, 4, 13, 35, 36, UBound(arrin, 2), 19, 28, 15, 2, 3) '1 Dimensional Array
        Dim ArrOut As Variant: Let ArrOut = Application.Index(arrin, rws(), clms()) 'See Post from #20 here for attempted explanation!  http://www.excelforum.com/excel-programming-vba-macros/1094827-copy-columns-from-sheet-1-to-sheet-2-using-column-heading-as-criteria-using-vba-2.html#post4139879
            wsOut.Cells(2, 1).Resize(UBound(arrin, 1), 12) = ArrOut
    
    End Sub
    Hope this post is another good contribution to this Thread.
    Alan Elston
    Last edited by Doc.AElstein; 08-07-2015 at 07:33 PM.

  22. #22
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Copy columns from sheet 1 to sheet 2 using column heading as criteria using VBA


    '''''''''

+ 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 Columns to another sheet based on column heading
    By jhall488 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2014, 03:46 PM
  2. [SOLVED] Auto copy contents from sheets 2 and 3 to sheet 1 if column heading contains set words
    By Thomas Andrews in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 06-09-2014, 11:59 AM
  3. how to copy columns of another sheet with the column data of current sheet
    By amethystfeb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2014, 11:28 PM
  4. [SOLVED] COUNTIF with multiple criteria on several columns (different column heading)
    By rose4emi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-20-2012, 06:41 AM
  5. [SOLVED] Search for heading in data sheet and copy range to corresponding sheet in master workbook
    By sans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-07-2012, 10:02 AM
  6. 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
  7. Search for column heading and copy column onto another sheet
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 05:53 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