saving a workbook

D

Dave

I have a small problem and don't know if what I am trying
to do is possible? I want to save a spreadsheet giving it
a name which is entered into a cell within the sheet. I
can do this manually by copying the contents of the cell
and then pasting them into the file name box after
selecting the 'save as' option. However, I need to
simplyfy this for a non-excel literate colleague, so I
want to record a macro to perform the whole process, when
I record the macro and then run it, it simply reverts the
cell in question back to it's original content and then
tries to overwrite the previously saved file. e.g. cell c1
= "smith" - overwrite to "brown" use macro to save as -
cell c1 reverts to "smith" and tries to overwrite itself.
Is there any way around this problem?
Thanks
Dave
 
F

Frank Kabel

Hi
try the following (using cell A1 from sheet 1)
sub save_it()
dim wks as worksheet
dim fname
Dim path

set wks = worksheets("sheet1")
path = "C:\Temp\"
fname=CStr(wks.Range("A1").value)

ActiveWorkbook.SaveAs Filename:=path & fName
end sub
 
Top