+ Reply to Thread
Results 1 to 3 of 3

Reading in CSV files

  1. #1
    Registered User
    Join Date
    11-13-2009
    Location
    Reading, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Reading in CSV files

    Hi there. I'm using the following code to read in any number of CSV files into a single worksheet and concatenating them together
    Please Login or Register  to view this content.
    It works fine the first time I run it after opening the workbook (I've got 12 rows of data across 3 CSVs) 12 rows are pasted and 1 blank row at the beginning.

    The second time I run it it pastes into the worksheet starting from row 14, and then 27 the third time etc.

    Does anyone know a way I can make sure it always pastes starting from row 1?

    Thanks in advance.
    Last edited by FactCheckinCuz; 11-16-2009 at 06:19 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reading in CSV files

    Hi FactCheckinCuz. Welcome to the forum.

    Be sure to read through the Forum Rules so you can use and follow them effectively. For instance, you'll need to edit that post above and put code tags around that code you used. (Like I did below...)

    Here's how I would structure your macro to remove the need to switch back and forth between sheets to copy the data in, and also how to start at row1 and move down.

    Please Login or Register  to view this content.
    I've highlighted in red the parts that relate directly to your question about the rows.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-13-2009
    Location
    Reading, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Reading in CSV files

    Thanks for the and advice JBEAUCAIRE.

    I have reformatted the code in my post and your codee solution to my problem works a treat. Brilliant

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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