+ Reply to Thread
Results 1 to 4 of 4

Quick Code Conversion

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    U.S
    MS-Off Ver
    Excel 2007
    Posts
    34

    Quick Code Conversion

    Hello,

    I just have a simple issue. The following code allows me to select a .csv file and add the file to my current excel file. I want to do the same thing, but with .xls files instead of .csv I know to change the .csv to .xls in the code, but the data is importing in the incorrect format. I know the issue is somewhere in the "Import Text Data" section at the bottom, but I'm not sure which parameter to change to get it to read the .xls files



    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    08-09-2012
    Location
    Anch, Alaska
    MS-Off Ver
    2003, 2010, 2013
    Posts
    131

    Re: Quick Code Conversion

    Take a look at this Link
    http://www.excelforum.com/excel-prog...using-vba.html


    You will need to set the Path and Range per your needs

    MyPath = "C:\"
    Set sourceRange = mybook.Worksheets(1).Range("A1:C1")

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

    Re: Quick Code Conversion

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    U.S
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Quick Code Conversion

    Thanks guys. I forgot to mention that I needed the new file to import onto a new tab/sheet. Patel45, with your code the new file opens up as it should, but on the tab that the macro was on (and deletes the button). Can you tweak it to where the data is put on a new tab/sheet?

+ 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