J
jazzzbo
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
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