+ Reply to Thread
Results 1 to 1 of 1

Help in transfering data from one excel file to other

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

    Help in transfering data from one excel file to other

    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
    Last edited by Excel_LEarner13186; 06-22-2011 at 10:37 PM.

+ 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