#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Link to text file

I am looking to link to data saved within a text file using excel. How can I
do this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Link to text file

Chris,

What do you actually want to do? Reading from or writing to a text file is
something Excel can do, for eaxmple the code below reads in 1 line at a time
from a text file and copies it to a worksheet.

Sub importtext()
x = 1
Open "c:\trial.txt" For Input As #1
Do While Not EOF(1)
Input #1, Line
Worksheets("sheet1").Cells(x, 1).Value = Line
x = x + 1
Loop
Close #1
End Sub

Mike

"Chris" wrote:

I am looking to link to data saved within a text file using excel. How can I
do this?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Link to text file

Hi Mike,

The text file is a report which contains telephone data. I need to take the
total number of calls received and answered from the file, and the date which
is in the file. The rest of the text in the file I don't need. Is there any
way of doing this with a formula as unfortunately I don't understand macro
coding.

Thanks for your help.
Chris

"Mike H" wrote:

Chris,

What do you actually want to do? Reading from or writing to a text file is
something Excel can do, for eaxmple the code below reads in 1 line at a time
from a text file and copies it to a worksheet.

Sub importtext()
x = 1
Open "c:\trial.txt" For Input As #1
Do While Not EOF(1)
Input #1, Line
Worksheets("sheet1").Cells(x, 1).Value = Line
x = x + 1
Loop
Close #1
End Sub

Mike

"Chris" wrote:

I am looking to link to data saved within a text file using excel. How can I
do this?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to link cell formatting in Excel from file to file KimW Excel Discussion (Misc queries) 4 August 17th 06 07:03 PM
Excel file link with word file kilianli Excel Worksheet Functions 1 March 10th 06 08:17 AM
Link footer of one file to cells in another file Laura Excel Discussion (Misc queries) 1 November 28th 05 08:59 PM
Using text in cells to build a link to within another file Jon Excel Discussion (Misc queries) 2 August 2nd 05 09:24 PM
External link only works for numbers -- for text values, #N/A is displayed unless linked file is open Sven Filter Links and Linking in Excel 1 February 22nd 05 08:10 AM


All times are GMT +1. The time now is 09:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"