पढ़ें पाठ डेटा फ़ाइल लाओ

यह कोड स्निपेट की एक पाठ फ़ाइल पढ़ता है और कार्यपत्रक में डेटा fetches.

व्याख्या

इस छोटे से कार्यक्रम के एक पूर्वनिर्धारित पूर्वनिर्धारित फ़ोल्डर या निर्देशिका में पाठ फ़ाइल में संग्रहीत पाठ निष्कर्षों की. कार्यक्रम में कई पाठ फ़ाइलों के माध्यम से "निर्देशिका में फाइल की सूची" कोड का उपयोग करके पाश को संशोधित किया है, यह अपने आप के द्वारा संशोधन की आवश्यकता है सकते हैं.

पूरे एक्सेल VBA प्रोग्राम इस पृष्ठ के नीचे, पर डाउनलोड करने का आनंद के लिए उपलब्ध है!

कोड

Public Sub ReadTextFileFetchData()

Dim NameOfFile As String
Dim PlaceOfFile As String
Dim Filelocation As String

NameOfFile = Range("c6").Value
PlaceOfFile = Range("c5").Value
Filelocation = PlaceOfFile + "\" + NameOfFile
sText = ReadTextFileFetchDataMain(Filelocation)
Range("c10").Value = sText

End Sub


Function ReadTextFileFetchDataMain(ReadTextFile As String) As String
Dim ReadTextFileSource As Integer
Dim ReadTextFile2 As String

'Closes text files that might be opened
Close
'The number of the next free text file
ReadTextFileSource = FreeFile
Open ReadTextFile For Input As #ReadTextFileSource
ReadTextFile2 = Input$(LOF(1), 1)
Close
ReadTextFileFetchDataMain = ReadTextFile2

End Function

 

 

 

डाउनलोड फ़ाइल Excel!Read_Text_File_Fetch_Data.xls

 

Add your comment

Your name:
Subject:
Comment: