LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem creating a set of .csv files from coinciding worksheets

I am trying to create a set of files named d1.csv, d2.csv, etc.
I have created a similar-named set of workbooks, named d1,d2...
As the files are written, I want them to automatically overwrite the previous file in the receivubg directore, without giving me a warning
When done, I want to delete the worksheets

The code I've written drops me off into nothingness.

Here is the code:
CSVPath = "J:\My Documents\Bridge\Updates\"

For i = 3 To 21
Sheets(i).Select
Application.CutCopyMode = False
Selection.Copy
Set NewWkb = ActiveWorkbook
ws1.Cells(200, 3).Value = j
ws1.Cells(201, 3).Value = "d" + Cells(200, 3).Text
CSVName = ws1.Cells(201, 3).Text
NewWkb.SaveAs CSVPath & CSVName, xlCSV
On Error Resume Next
NewWkb.Close False
Next
For i = 3 To 21
Sheets(i).Delete
Next

I know, it's clumsy. I'd appreciate suggestions on how to improve any of it.

Thanks
Jim Berglund
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem creating formulas when exporting QuickBooks files to Excel edpoz New Users to Excel 1 December 8th 09 11:19 PM
Problem with creating Worksheets with Macros Jim Excel Programming 8 April 12th 09 05:50 PM
Network Files creating temporary files Dave Weastec Excel Discussion (Misc queries) 0 October 3rd 08 02:26 PM
Formula for coinciding columns... Schwimms Excel Discussion (Misc queries) 4 February 19th 08 03:14 AM
Creating PDF Files from Multiple Worksheets Using VBA George Lynch Excel Programming 7 March 10th 05 09:11 PM


All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"