Home Page Google Tips Quickbooks Tips Other Tips Peachtree Accounting DDE Tips Peachtree Accounting Tips Microsoft Excel Tips Our Store Site Map Training Recent Projects Our Services Home Page
Accounting Advisors Logo Navigation Bar
 
Quick Links
- Learn How We Can Help
- Read About Recent Projects
- Schedule a Class
- Pay Your Invoice Online
- Request Technical Support

Free Newsletter
You'll receive Peachtree tips, Excel tips, and more!

Newsletter Archives
Privacy Policy
Did you know?
We offer technical support for Peachtree Accounting, Microsoft Excel, and DDE by e-mail, telephone, or remotely.
Double Line Bar   Recommended Books Links VBA Tips Formula Tips Downloads General Tips
Microsoft Excel
Microsoft Excel VBA Tips (Page 2 of 2)
There are 13 Microsoft Excel VBA tips available.
View All VBA Tips
Small Logo Importing Text Files
Here is a tip which may help you when importing text files into Excel. If you frequently import comma delimited files into Excel, you might not realize that you can open the text file, read each line directly, then close the file, as shown here:

Sub ReadTextFile()
'Open text file for reading
Open "Data.prn" For Input As #1
'Process each line in file, until end of file is reached
Do While Not EOF(1)
'Read first record of a line
Input #1, Rec1
'Determine if blank line
If Rec1 = Empty Then
'Blank line - do nothing
Else
'Otherwise, read remaining records on line
Input #1, Rec2, Rec3, Rec4, Rec5, Rec6
'Write records to the Debug window
Debug.Print Rec1, Rec2, Rec3, Rec4, Rec5, Rec6
End If
Loop
'Close text file
Close #1
End Sub

The alternative is to open the CSV file as a workbook, select the active area, copy it to the clipboard, then paste it into where you need it. (We'll soon modify this to write the data directly to cells, rather than just to the debug menu).
Small Logo Baffled by Dynamic Data Exchange (DDE)?
Check out these tips that relate primarily to Peachtree Accounting, but may be helpful in other instances also.
Small Logo Importing a Lotus 1-2-3 Spreadsheet into Excel
Importing a Lotus 1-2-3 spreadsheet into Excel can leave you with dozens or hundreds of comments where formulas didn't convert. An easy way to clear all of these comments at once is to use the following routine:

Sub ClearComments()
For Each c In ActiveSheet.Comments
c.Delete
Next
End Sub

Page: 1   2  

Accounting Advisors, Inc.
614 Park Avenue SE
Atlanta, Georgia 30312
Telephone: 404-784-0275
Toll Free: 800-724-0315
Fax: 404-420-2175
Privacy Policy


[Home Page] [Our Services] [Recent Projects] [Training] [Support]
Tips: [Excel] [Peachtree] [Quickbooks] [Google] [DDE] [Other]
[Pay Your Invoice] [Driving Directions] [Site Index]

Valid HTML 4.01!
Valid CSS!
About Our Site

Left Footer
Questions? Comments?
E-mail us
or call (404) 784-0275
Our toll free number is (800) 724-0315
© Copyright 2004 by Accounting Advisors
Web site designed and maintained by Accounting Advisors, Inc.
Right Footer