I have a piece of VBA that I wrote that does some calculations and filtering and dumps the results onto a separate worksheet in the proper format that I need it in. Works fine. Then I added some code that should copy that worksheet to a specific location on the network, so that the data can be picked up my another application. Here's the code:
Dim Export As Worksheet
Set Export = Worksheets("To Proman")
Dim PN As Range
Set PN = Export.Range("A1")
Export.SaveAs "K:\" & PN & ".txt", xlCSV, , , , False
The code works fine for exporting the the data in the correct format and correct file name, ext.
HOWEVER: The code automatically renames both the original workbook and the worksheet to my filename, which I use for many other things. I don't want this to happen, as it screws up the other VB I've written.
So, how can I export this worksheet as a CSV and not rename my current file or any of my current worksheets?