I have created a macro to save smaller workbooks for email contacts, to use in Business contact manager. I am cutting and pasting from huge .csv file to books of 50 contacts or less. It works great until time to save file, an it wants to overight the last file.
Here is example of macro.
Selection.Delete Shift:=xlUp
Selection.Cut
Workbooks.Add
Rows("1:1").Select
ActiveSheet.Paste
ActiveWorkbook.SaveAs Filename:="C:\Users\XPS 8500\Desktop\Book20.csv", _
FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
The save as is where the problem comes in. How do I make the macro save to next in line book? IE Book21.csv and continue on to unlimited books in sequence.
Any help will be appreciated as I have a bunch of these to do now and in the future.
Here is example of macro.
Selection.Delete Shift:=xlUp
Selection.Cut
Workbooks.Add
Rows("1:1").Select
ActiveSheet.Paste
ActiveWorkbook.SaveAs Filename:="C:\Users\XPS 8500\Desktop\Book20.csv", _
FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
The save as is where the problem comes in. How do I make the macro save to next in line book? IE Book21.csv and continue on to unlimited books in sequence.
Any help will be appreciated as I have a bunch of these to do now and in the future.