tcorcoran15
New Member
- Joined
- Feb 16, 2017
- Messages
- 22
Hello,
I have the following code which names a sheet after a specified cell and then copies into a new workbook.
The next stage attempts to save the workbook after another cell value however this is where I became stuck.
Cell D2 can contain special characters so the save as isn't working correctly.
Is it possible to save as a specified cell removing the special characters? Without removing the special characters from the cell?
For example, ABC LTD T/A TOMS CAKE SHOP would become ABC LTD TA TOMS CAKE SHOP
Any help is greatly appreciated.
I have the following code which names a sheet after a specified cell and then copies into a new workbook.
The next stage attempts to save the workbook after another cell value however this is where I became stuck.
Cell D2 can contain special characters so the save as isn't working correctly.
Is it possible to save as a specified cell removing the special characters? Without removing the special characters from the cell?
For example, ABC LTD T/A TOMS CAKE SHOP would become ABC LTD TA TOMS CAKE SHOP
Any help is greatly appreciated.
Code:
Set wh = Worksheets(ActiveSheet.Name)
ActiveSheet.Name = wh.Range("Q2").Value
ActiveSheet.Copy
Application.DisplayAlerts = False ' suppress overwrite warning message
ActiveWorkbook.SaveAs Filename:="X:\Company Name\Product\Product - Live\Reports\Credit Control Files\" & Range("D2"), _
FileFormat:=51, _
CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close SaveChanges:=False
Last edited: