Results 1 to 4 of 4

Unable to copy and paste a text file into excel

Threaded View

  1. #1
    Registered User
    Join Date
    07-19-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    67

    Unable to copy and paste a text file into excel

    Hi all,

    i am trying to open multiple text files, copy and paste in single excel sheet ( one by one). i am use below code it open all the text file into excel but unable to copy and paste in single excel sheet. can any one help..

    Sub loopyarray()
    
       Dim filenames As Variant
    
       ' set the array to a variable and the True is for multi-select
       filenames = Application.GetOpenFilename(, , , , True)
    
          counter = 1
    
          ' ubound determines how many items in the array
          While counter <= UBound(filenames)
    
             'Opens the selected files
             Workbooks.Open filenames(counter)
    
             ' displays file name in a message box
             MsgBox filenames(counter)
    
             'increment counter
             counter = counter + 1
             
    
          Wend
       End Sub

    Thanks

    Jack
    Last edited by arlu1201; 07-23-2012 at 03:53 AM. Reason: Use code tags in future.

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