Morning all
Using what I have learned, today I managed to copy a range of one sheet to a new sheet preserving formatting using the paste special method. This sheet is then copied to a new workbook that opens, saves and closes using the below code.
This method although very simple does not seem to duplicate the formatting like manually copying a sheet to a new workbook. Is there a simple addition to this I am missing that would preserve the formatting or should I look at another way of doing it, like copy and paste special to a new workbook.
Thanks again.
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Application.DisplayAlerts = False[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]ThisWorkbook.Sheets("PMimp").Copy
ActiveWorkbook.SaveAs Filename:="X:\CIS\Fire Iinstallations\Temp\PMimp.csv", FileFormat:=xlCSV, CreateBackup:=True
ActiveWorkbook.Close[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Application.DisplayAlerts = True[/FONT]
Using what I have learned, today I managed to copy a range of one sheet to a new sheet preserving formatting using the paste special method. This sheet is then copied to a new workbook that opens, saves and closes using the below code.
This method although very simple does not seem to duplicate the formatting like manually copying a sheet to a new workbook. Is there a simple addition to this I am missing that would preserve the formatting or should I look at another way of doing it, like copy and paste special to a new workbook.
Thanks again.
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Application.DisplayAlerts = False[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]ThisWorkbook.Sheets("PMimp").Copy
ActiveWorkbook.SaveAs Filename:="X:\CIS\Fire Iinstallations\Temp\PMimp.csv", FileFormat:=xlCSV, CreateBackup:=True
ActiveWorkbook.Close[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Application.DisplayAlerts = True[/FONT]