+ Reply to Thread
Results 1 to 4 of 4

vba macro send specific columns to another workbook

  1. #1
    Registered User
    Join Date
    11-28-2022
    Location
    england
    MS-Off Ver
    365
    Posts
    28

    vba macro send specific columns to another workbook

    hi

    i have now gone into more detail as the requirements have now changed

    I'm after a macro that will copy and paste specific columns from 1 workbook to another. what i would like the macro to do is the following,



    copy columns C,H,D,E,J,l,M,K,W,P,X,Y from one workbook (sheet1) and paste them to another workbook (sheet name: order book) in in column, A,B,C,D,E,F,G,H,I,J,K,L. i will have the header in row 1 so the information will need to be taken from row 2 and work its way down until it reaches the last row.

    unfortunalty the macro cannot pull data by header name because both work books does not have the same headers.

    please see attached , I hope it makes it more clearer.



    any help will be really appreciated.
    Attached Files Attached Files
    Last edited by excel_rooki; 01-16-2023 at 12:49 PM. Reason: mistake with wording

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: vba macro send specific columns to another workbook

    You need to post a better example workbook as you only have one sheet which does not clarify exactly what you require.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

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

    Cool Hello, try this !


    According to your attachment a beginner starter VBA demonstration to paste only to the Book2 Sheet1 worksheet module
    which crashes when Book1 is not already opened or when headers do not exactly match between worksheets (no typo allowed) :

    PHP Code: 
    Sub Demo1()
        [
    '[Book1.xlsx]Sheet1'!A1].CurrentRegion.AdvancedFilter 2, , [A1:C1]
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 01-12-2023 at 02:21 PM.

  4. #4
    Registered User
    Join Date
    11-28-2022
    Location
    england
    MS-Off Ver
    365
    Posts
    28

    Re: vba macro send specific columns to another workbook

    hi John, please see my original post, I have now gone into more detail.

+ 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] Macro to copy specific Columns from One Workbook to another
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-12-2022, 08:48 AM
  2. Macro to copy data from specific columns from One Workbook to Another
    By flupsie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2018, 12:59 PM
  3. Macro to select specific columns in the same workbook
    By lskyy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2016, 05:11 PM
  4. [SOLVED] Import specific columns from workbook A sheet1 to workbook B Sheet 2 to specific columns
    By Vassen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2016, 07:01 AM
  5. Macro to copy data from specific columns and paste to new workbook
    By jcs2811 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2014, 10:15 PM
  6. Programming to automatically send text to specific sheets and specific columns.
    By GlobalExcelller in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2014, 10:07 PM
  7. [SOLVED] Macro to Transfer Specific Columns from One workbook to another
    By luke.guthrie in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-16-2012, 11:07 AM

Tags for this Thread

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