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!

Script to read Excel & extract data to a text file

Status
Not open for further replies.

NickC111

Technical User
Sep 23, 2010
44
GB
I have a Excel spreadsheet that has several worksheets with headers in row 1 and then data on every line

I would like to know if there is a way that I could use a script to the read the worksheet and extract the data to a text file. Each row in the worksheet would have a new line.

Example

Worksheet called 'Property'

Column B = 1st Row Header = Void Address
Column C = 1st Row Header = Tenancy Name
Column D = 1st Row Header = Vacation Date

Worksheet called 'Garage'

Column B = 1st Row Header = Garage Address
Column C = 1st Row Header = Tenancy Name
Column D = 1st Row Header = Garage Reference

The script would create two text files called 'Property' & 'Garage'

It would be great if the file could be a CSV so the data is separated by a comma

Any help would be great

Thanks

 
hi,

Is that because you have no Excel application available on your PC?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Sorry for the delay been on annual leave.

I do have access to Excel but I am trying to automatic the process by using batch scheduler that runs scripts to extract the required information
 
Write a procedure to run in THAT workbook's Workbook_Open event, that simply SAVES the appropriates sheets as .csv text files.

Then have your scheduler just open the workbook, and close when both text files are available.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top