![]() |
Save as !
I have made a control button on my worksheet, to "save as"
Is there a way I can program this button to recognise a name in a cell and use that name as the filename to save as. I realise there is a button for it in the file menu, but I've been asked to put one on the Work sheet. Thanks |
Save as !
try,
Sub SaveASCellValue() ActiveWorkbook.SaveAs Filename:=Range("A1").Value ActiveWorkbook.SaveAs Filename:=Range("A1").Value End Sub -- Regards Corey |
Save as !
Thank you, works a treat.
"Corey" wrote: try, Sub SaveASCellValue() ActiveWorkbook.SaveAs Filename:=Range("A1").Value ActiveWorkbook.SaveAs Filename:=Range("A1").Value End Sub -- Regards Corey |
Save as !
Corey wrote:
try, Sub SaveASCellValue() ActiveWorkbook.SaveAs Filename:=Range("A1").Value ActiveWorkbook.SaveAs Filename:=Range("A1").Value End Sub I also would like to do this, but when I try, I get an error message :A file named 'TRUE.xls' already exists in this location. But the contents of A1 contain 'TEST' or NOW() or other text. What am I doing wrong ? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 |
Save as !
I adapted the advice given to read;
ActiveWorkbook.saveas Filename:=("C:\Documents and Settings\steve\Desktop\") + Range("E7").Value the code line is only written once. And it saves to my desktop, and from there I can move it to the required storage place. I only get an error messageit I try to resave using my button and I havent changed the file name.Thats when you get the File already exists line and asks if you wish to overwrite it. Hope this helps. Steve "Francois via OfficeKB.com" wrote: Corey wrote: try, Sub SaveASCellValue() ActiveWorkbook.SaveAs Filename:=Range("A1").Value ActiveWorkbook.SaveAs Filename:=Range("A1").Value End Sub I also would like to do this, but when I try, I get an error message :A file named 'TRUE.xls' already exists in this location. But the contents of A1 contain 'TEST' or NOW() or other text. What am I doing wrong ? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 |
Save as !
I suspect you've written
.... Filename=Range("A1").Value instead of .... Filename:=Range("A1").Value Note the colon after "Filename" I can't see the beginning of this thread so I don't know why Corey suggests doing the SaveAs twice.. Francois via OfficeKB.com wrote: Corey wrote: try, Sub SaveASCellValue() ActiveWorkbook.SaveAs Filename:=Range("A1").Value ActiveWorkbook.SaveAs Filename:=Range("A1").Value End Sub I also would like to do this, but when I try, I get an error message :A file named 'TRUE.xls' already exists in this location. But the contents of A1 contain 'TEST' or NOW() or other text. What am I doing wrong ? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 |
Save as !
Andrew Taylor wrote:
I suspect you've written ... Filename=Range("A1").Value instead of ... Filename:=Range("A1").Value Note the colon after "Filename" I can't see the beginning of this thread so I don't know why Corey suggests doing the SaveAs twice.. try, [quoted text clipped - 13 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 Thanks folks All is OK now -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 |
Save as !
Andrew Taylor wrote:
I suspect you've written ... Filename=Range("A1").Value instead of ... Filename:=Range("A1").Value Note the colon after "Filename" I can't see the beginning of this thread so I don't know why Corey suggests doing the SaveAs twice.. try, [quoted text clipped - 13 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 Thanks folks All is OK now -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 |
All times are GMT +1. The time now is 09:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com