Results 1 to 2 of 2

Open and paste a .txt file to a pre-defined table

Threaded View

  1. #1
    Registered User
    Join Date
    01-25-2009
    Location
    Geneva, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    1

    Open and paste a .txt file to a pre-defined table

    Hi all,

    1. I have a pre-formatted spreadsheet. Would it be possible using a macro to open a text file (note I have files for everyday of the month) to a pre-defined table in a spreadsheet.

    This macro would be taking place of selecting my table and using Get External Data> Import Text File.

    This needs to be connected to a command button that is located on the spreadsheet.

    2. I have a command button that clears all the data from the pre-defined data table.

    3. This is to simplify everything for my employees (about 6) to be able to view data but to be able to look at certian variable that are in formulas like averages and simple addition to determine data from that day.

    I can also supply a copy of my spreadsheet and a couple days of data if it will help.



    Also here is what I have for code on it right now.
    Sub l()
    '
    ' l Macro
    '
    '
    Application.Goto Reference:="Ls1_data"
    Dim Fname As Variant
    Fname = Application.GetOpenFilename("Text Files (*.txt),*.txt", , _
    "Select Text Data File")
    If Fname = False Then Exit Sub
    Worksheets("Template").Range("A7:P1447").Select
    Close
    End Sub
    Where Im not sure where to go is how to take the file I opened from the dialog and paste it to my table.

    I have included my template, 3 days of data and 2 macros

    If anyone can help Thanks



    Tim
    Attached Files Attached Files
    Last edited by Leith Ross; 01-25-2009 at 11:39 PM.

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