Closed Thread
Results 1 to 1 of 1

copy from txt file

  1. #1
    Registered User
    Join Date
    02-13-2006
    Posts
    46

    copy from txt file

    Locked as code not wrapped

    Hi,
    My requirement is to copy the content of a file from txt file and paste it in a workbook. from google i got this code
    Dim DestBook As Workbook, SourceBook As Workbook
    Dim DestCell As Range
    Dim RetVal As Boolean
    Application.ScreenUpdating = False
    Set DestBook = ActiveWorkbook
    Set DestCell = ActiveCell
    RetVal = Application.Dialogs(xlDialogOpen).Show("*.*")
    If RetVal = False Then Exit Sub
    Set SourceBook = ActiveWorkbook
    Range(Range("A1"), Range("A1").SpecialCells(xlLastCell)).Copy
    DestBook.Activate
    DestCell.PasteSpecial Paste:=xlValues
    SourceBook.Close False
    When i run this, it opens the file selection dialogue box and then it asks for selecting delimiter options. i want to skip the delimiter selection. any way to do it. my macro should be simply copy paste from the txt file
    any other code is welcome.
    Ashish
    Last edited by VBA Noob; 04-03-2007 at 02:14 PM.

Closed 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