Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2004
    Thanked 0 Times in 0 Posts

    loops to update new data (2000)

    1).I have a program/job on an ibm mainframe that strips data from a file - it then creates a new file called FILEA.
    2). I then take FILEA and ftp the file into a text file - called FILEB
    3). I created an excell spreadsheet with two different sheets (sheet1 & sheet2).
    4). I imported FILEB into sheet1 (all this has is one column 12 rows - all data numeric - no headings)
    5). I then wrote a macro on sheet2 to bring in the data from the individual cells on sheet1 to their corresponding cells on sheet2
    6). Sheet2 consists of headers of dates from column A through column XXXXX.
    7). I need a macro that will take my daily updated information on sheet1 and put it in the individual columns on sheet2 daily.

    2 |
    --------------------------- <-------- data gets updated every day from program on ibm. so text file gets updated, which means sheet1 gets updated.
    3 |

    2 | 54 | 73 |
    ---------------------------------|-------------------- <-------- new daily data gets applied to new columns from ibm job/text file/sheet1s (same columnA rows1-12).
    3 | 8 | 2 |
    ---------------------------------| ------------------------
    27 | 34 | 123 |

    so can anybody help...

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    California, USA
    Thanked 0 Times in 0 Posts

    Re: loops to update new data (2000)

    Have you considered reading one line of text from the text file, bringing each line into a cell in the workbook and then breaking the line up to meet your needs. In this example you only need one sheet.

    Sub Test_Text()

    Dim LineofText As String
    FType = "C:YourFile.Txt"

    Open FType For Input As #1
    Do While Not EOF(1)
    Line Input #1, LineofText
    Range("TextLine") = LineofText 'Define a rangename in a cell called "TextLine"
    Additional code here if needed

    Close #1

    End Sub

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: loops to update new data (2000)

    This question has already been asked in <post#=364415>post 364415</post#>. To avoid confusion and duplication, I am locking this thread. Please continue the discussion in the other thread. Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts