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. #1
    Junior Member SDruley's Avatar
    Join Date
    Nov 2012
    Posts
    23
    Rep Power
    0

    Lightbulb Importing a csv File to a range

    Code:
    Sub PortToStage()
    Dim PicassoPage As Range
    Set PicassoPage = Application.Range("BANKA")
    Dim X As Long, FF As Long, S() As String
    ReDim S(1 To PicassoPage.Rows.Count)
    For X = 1 To PicassoPage.Rows.Count
    S(X) = Join(WorksheetFunction.Transpose(WorksheetFunction. _
    Transpose(PicassoPage.Rows(X).Value)), ",")
    Next
    FF = FreeFile
    Open "c:\TTND\PicassoPg.cvs" For Output As #FF
    Print #FF, Join(S, vbNewLine)
    Close #FF
    End Sub
    Rick Rothstein back in 2009 was responsible for creating the above code. I have modified it to include my specific range name, "PicassoPage" where previously it indicated "Selection".
    I hope I don't get into trouble on my first post on this site but I have seen Rick's work and it is my opinion he is the best programmer in the country.

    So, I am looking for help in creating code to take the above generated file (PicassoPg.cvs) created using Workbook A and pull it into a range with the same name and configuration in Workbook B, sort of like a parallel universe thing. Both workbooks have easy access to the csv file and when you look at the corresponding worksheets in both workbooks they look identical. The only difference is that the range name in workbook B is "BankB"



    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA



    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 06-10-2023 at 04:31 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
  •