Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
With regards to EXCEL how we read the text file in EXCEL sheet using MACRO. The file is located in d:\Sql\Documents\Amit\log.txt. I want to save the EXCEL sheet, and every time when I open this sheet it reads this text file and displays the contents of this text file in Excel Sheet. I want to use MACRO for reading this text file.How I do that? Thanks Amit |
#2
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
fileName = "D:\Sql\Documents\Amit\log.txt"
Workbooks.OpenText FileName:=fileName OR Workbooks.OpenText FileName:=fileName, Origin:=xlWindows, StartRow _ :=1, DataType:=xlFixedWidth, FieldInfo:=Array( _ Array(0, 2), Array(10, 2). . .) Alex "AMIT" wrote in message om... Hello, With regards to EXCEL how we read the text file in EXCEL sheet using MACRO. The file is located in d:\Sql\Documents\Amit\log.txt. I want to save the EXCEL sheet, and every time when I open this sheet it reads this text file and displays the contents of this text file in Excel Sheet. I want to use MACRO for reading this text file.How I do that? Thanks Amit |
#3
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Thanks for your information. But I still need some more info about the problem. Actually I want that every time when I run the macro, it refreshes the information from the text file, from the following path (d:\Sql\Documents\Amit\log.txt) and display its contents on the Excel sheet. How should I record the macro in order to perform this operation? Best Regards Amit. "biju" wrote in message ... Dear Amit Pls. enable the macro record option from tools menu after opening excel and use the manual way of opening the text file by listing only text files and selecting it..stop/close recording the macro after assigning a shortcut(keys) and thats it.. with regards biju Eg : Sub Macro1() ' ' Macro1 Macro ' Macro recorded 12/30/2003 by biju ' ' Keyboard Shortcut: Ctrl+l ' ChDir "d:\Sql\Documents\Amit\" Workbooks.OpenText Filename:="d:\Sql\Documents\Amit\log.txt", Origin:=xlWindows, StartRow _ :=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _ , Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _ Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), _ Array(10, 1), Array(11, 1)) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Split text file into Excel sheet and separate the final results intoa new sheet | Excel Worksheet Functions | |||
How do you save an excel file to be read as IBM-type text file ? | Excel Worksheet Functions | |||
Neet to use Excel to read in multiple-sheet file | Excel Worksheet Functions | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) | |||
Read text file | Excel Programming |