Results 1 to 10 of 22

Thread: Importing a csv File to a range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    13
    Use:
    Code:
    Sub M_snb()
       sn = Application.Range("BANKA")
    
       For j = 1 To UBound(sn)
         c01 = c01 & vbCrLf & Join(Application.Index(sn, j), ",")
       Next
    
       CreateObject("scripting.filesystemobject").createtextfile("c:\TTND\PicassoPg.csv").write Mid(c01, 3)
    End Sub
    If the range contains errors (resulting from formulae) it will error out.
    In that case you have to remove those first.

    You can use a querytable in the second workbook to keep it updated with the csv file.
    I think you can have a querytable connection directly to the workbook in the other Excel instance.
    Last edited by snb; 11-17-2012 at 04:46 PM.

Similar Threads

  1. Macro To Close All CSV Files
    By Howardc in forum Excel Help
    Replies: 5
    Last Post: 03-15-2014, 05:24 PM
  2. Save Excel 2010 File In CSV Format VBA
    By mag in forum Excel Help
    Replies: 7
    Last Post: 01-08-2013, 07:16 PM
  3. Macro to export sheet as CSV
    By Howardc in forum Excel Help
    Replies: 2
    Last Post: 07-25-2012, 08:59 PM
  4. Replies: 1
    Last Post: 06-02-2011, 10:38 AM
  5. Save File In CSV Format VBA
    By Raj Kumar in forum Excel Help
    Replies: 3
    Last Post: 06-01-2011, 07:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •