+ Reply to Thread
Results 1 to 4 of 4

macro to concatenate 3 COLUMNS from one workbook into 1 COLUMN IN ANOTHER WORKBOOK

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    86

    macro to concatenate 3 COLUMNS from one workbook into 1 COLUMN IN ANOTHER WORKBOOK

    I have 3 columns in my source workbook, column D (mONTH), COLUMN E (DAY), COLUMN F (YEAR), i would like to combine all the cloumns as 11/13/2013 and export that to another workbook which has a column (R) Birthdate. I already have a macro that copies between the workbook so i would like to incorporate that within this code


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: macro to concatenate 3 COLUMNS from one workbook into 1 COLUMN IN ANOTHER WORKBOOK

    Try the following tested using Excel 2003.
    Obviously I did not have your template file, but I did create a simulated .csv file.
    It seemed like your data had a header row, that's why I started at row 2.
    All the code I added is indented to the left.

    Please Login or Register  to view this content.
    If you want dates of the format mm/dd/yyyy each data item should be validated as numeric
    to prevent a runtime error, such as
    Please Login or Register  to view this content.

    Lewis

  3. #3
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: macro to concatenate 3 COLUMNS from one workbook into 1 COLUMN IN ANOTHER WORKBOOK

    Hi,
    You can also used the DateSerial function to build the date

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: macro to concatenate 3 COLUMNS from one workbook into 1 COLUMN IN ANOTHER WORKBOOK

    You can also used the DateSerial function to build the date
    Excellent point GC. However if the cells contain non-numerics or blanks, DateSerial will produce a run-time error.

+ 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. Macro to copy and paste columns from one workbook to a new workbook
    By windcloud2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2012, 11:45 AM
  2. Copy columns from closed workbook to different columns in open workbook
    By jGLZa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2012, 11:03 PM
  3. Replies: 0
    Last Post: 07-27-2011, 09:48 PM
  4. Need macro to Concatenate columns in one workbook and copy to another workbook
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2010, 05:14 PM
  5. Replies: 1
    Last Post: 04-01-2006, 03:50 PM

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