+ Reply to Thread
Results 1 to 5 of 5

VBA to Copy the same Columns from multiple files in one folder

  1. #1
    Registered User
    Join Date
    08-30-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA to Copy the same Columns from multiple files in one folder

    I have a code that I am using to copy the same columns (A:F) from multiple files in the same folder. It executes without error, and loops through all of the .xls files in the folder. But it only returns results from the first file. Where is my error?
    Thank you


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA to Copy the same Columns from multiple files in one folder

    Run your macro step by step with F8 and check value of NRow in line
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: VBA to Copy the same Columns from multiple files in one folder

    that code is working fine but next empty row is taking wrong thats it

    try this code hope this will work
    Please Login or Register  to view this content.
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  4. #4
    Registered User
    Join Date
    08-30-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA to Copy the same Columns from multiple files in one folder

    It doesn't like this portion of the code
    Please Login or Register  to view this content.
    Says subscript out of range

    As far as looking at the NRow = NRow + DestRange.Rows.Count
    I am unsure how to modify this?

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA to Copy the same Columns from multiple files in one folder

    Please Login or Register  to view this content.
    Last edited by patel45; 01-16-2014 at 03:19 AM.

+ 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 files from one folder to another folder (path in textbox)
    By yoko21 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2014, 02:45 AM
  2. Copy a Template workbook ans paste in a multiple Files in a Folder
    By arvind1979_3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-24-2013, 09:07 AM
  3. [SOLVED] VBA Code open files in folder, copy text to workbook-Next time folder opened copy only new
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2013, 07:59 PM
  4. Replies: 3
    Last Post: 02-22-2012, 11:40 AM
  5. Replies: 1
    Last Post: 09-22-2010, 11:00 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