ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to save current excel sheet only without losing formatting (https://www.excelbanter.com/excel-programming/391840-macro-save-current-excel-sheet-only-without-losing-formatting.html)

Genesis

macro to save current excel sheet only without losing formatting
 
I have a macro that saves the current worksheet only (fileformat=xlNormal),
and automatically generates a new filename, but formatting is lost, so
reprinting the sheet looks completely different from the original.

joel

macro to save current excel sheet only without losing formatting
 
What file exttension are you saving XLS or CSV? CSV will not save the
formatting. I think your problem is the file extension you are using.

"Genesis" wrote:

I have a macro that saves the current worksheet only (fileformat=xlNormal),
and automatically generates a new filename, but formatting is lost, so
reprinting the sheet looks completely different from the original.


Tom Ogilvy

macro to save current excel sheet only without losing formatting
 
this is just a guess:
Activeworkbook.SaveAs "C:\Mybook", fileformat:=xlNormal

note the colon before the equal sign.

If I don't have the colon, I get an error, but perhaps for you it saves it
as some kind of text file.

--
Regards,
Tom Ogilvy

"Genesis" wrote:

I have a macro that saves the current worksheet only (fileformat=xlNormal),
and automatically generates a new filename, but formatting is lost, so
reprinting the sheet looks completely different from the original.



All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com