Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to sort an excel spreadsheet

Status
Not open for further replies.

tmm

Programmer
Oct 27, 1999
1
US
I am writing an VB application that reads a text file, populates an excel spreadsheet with specific data from the text file and save the spreadsheet as a dBASE IV file. Prior to saving as a .dbf file, I need to sort the spreadsheet. I'm not having any luck with this, can anyone help?<br>
<br>
Thanks
 
Tmm,<br>
<br>
Why don't you create a reference to an &quot;Excel.Application&quot; in your project, then add a reference to the document where you are write the records to. Next I would go into excel, open the file with sample data in it. Start to record a new macro (from the tools/macro menu). Next use excel to do the sort, when you are happy with the results stop the macro. I would then open the macro in design mode and copy and paste your code in VB, making changes to allow for the fact that the variable you referenced will be doing this. <br>
<br>
I use this method when I writing code for office applications and don't know the correct office VBA syntax - it works for me.<br>
<br>
Let me know if you need an example - I'll try and do it myself.<br>
<br>
C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top