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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output selection to file

Status
Not open for further replies.

pglover

Technical User
Jul 18, 2001
33
GB
Hi

Apologies for 'noddy' question - time frame precludes proper investigation ;-)

Have spreadsheet - want to save each record (four cells in row) to csv file, named as content of first cell. Naming is not a problem, but can I output to a csv file?

Thanks in advance of any replies

Penny
 
Hi Penny.
dim i as integer, j as integer

Range("A1").Select
i=1
Do
Open "C:\" & ActiveCell & ".csv" for output as i
for j=0 to 4
print #i, ActiveCell.Offset(j, 0) & ";"
next
close i
i=i+1
ActiveCell.Offset(-4,1).Select
Loop Until IsNull(ActiveCell)

It's not fully tested, but it should give you an idea.

Cheers,
MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
Many thanks Andreas - now working a treat ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top