Formatting Report , Formatting Text Files, Aligning Text File
For a Neatly Spaced Text File:
Sub EquiSpaced_TextFile()
' ---------------------------------------------------------------
' Written By Shanmuga Sundara Raman for http://vbadud.blogspot.com
' ---------------------------------------------------------------
Dim iMaxLength As Integer
iMaxLength = 20
Open "d:\VBADudExamples\TabbedFile.txt" For Output As #1 ' Open file for output.
Print #1, "Name "; Tab(iMaxLength); "Santhosh Prabhakaran"
Print #1, "Place "; Tab(iMaxLength); "Madras"
Print #1, "Designation "; Tab(iMaxLength); "Admin Manager"
Close #1 ' Close file.
' Excel VBA, Write to Text File, Neatly Spaced Text File
End Sub
No comments:
Post a Comment