+ Reply to Thread
Results 1 to 2 of 2

Data transfer between workbooks

  1. #1
    Registered User
    Join Date
    06-22-2011
    Location
    california
    MS-Off Ver
    Excel 2003
    Posts
    6

    Data transfer between workbooks

    Hey,

    I have a rather simple issue I guess. I am trying to transfer data from one excel file to other. I tried using the following code but it shows some funny text that I dont understand. Can someone please help me resolve this fast.

    Application.ScreenUpdating = False
    Dim sPath As String
    Dim fName As String
    Dim s As String
    s = CurDir
    'sPath = "C:\Myfolder\Myfiles"
    ChDrive sPath
    fName = Application.GetOpenFilename( _
    Filefilter:="Excel Files (*.xlsx),*.xlsx")
    ChDrive s
    ChDir s
    If LCase(fName) = "false" Then Exit Sub
    With ActiveSheet.QueryTables.Add _
    (Connection:="TEXT;" & fName, _
    Destination:=Cells(Rows.Count, "A").End(xlUp).Offset(1))
    .Name = Replace(LCase(fName), ".xlsx", "")

    .TextFileStartRow = 2
    .TextFileParseType = xlDelimited
    .TextFileTextQualifier = xlTextQualifierDoubleQuote
    .TextFileConsecutiveDelimiter = False
    .TextFileTabDelimiter = False
    .TextFileSemicolonDelimiter = False
    .TextFileCommaDelimiter = True
    .TextFileSpaceDelimiter = False
    .Refresh False
    End With
    Edit/Delete Message

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Thanks for all the help

    Hi excel_learner, you have posted your problem in the wrong thread. You won't get any help in here. Plus, whenever you show code, you must wrap it with code tags as described by Rule # in the forum rules located here.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ 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