Consulting

Results 1 to 3 of 3

Thread: Copy selective columns from one worksheet to another in the same workbook

  1. #1
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    1
    Location

    Question Copy selective columns from one worksheet to another in the same workbook

    Is there a way to select some columns from a worksheet and copy those in another worksheet in the same workbook? I can do it using the vba macro, but that's slow. so I'm trying to do it by using SQL where first worksheet can be treated as a db table. any help would be greatly appreciated!

    Thank you
    Nick

  2. #2
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    I can do it using the vba macro, but that's slow.
    If you are finding that VBA is slow, I suspect that it is because you are not writing your VBA in a "fast" style.
    I started a thread sometime ago which compared different methods of copying data from one sheet to another, different methods had radically different times. One method took 0.34 seconds another common method took 18.12 seconds.
    So if you are thinking of using SQL just to speed things up, I suggest you check that you have exhausted the possibilities of speeding up VBA.
    See this thread:
    http://www.vbaexpress.com/forum/show...-variant-array

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •