Save or SaveAs Macro

K

knosalaa

I have several files on Co Network and would like to build a Macro
(behind a button) that would auto assign file name (using workbook cell
reference - one identify name and second cell date) and when button is
pressed it would perform save or saveas function re-directing that file
to a specific network directory. I have tried several combinations with
both save and saveas but in save it will not allow me to reference
cell's from which i woulod like to enter name and with saveas function
it allows me to assign name but it will not recognize network address
where i would like to save the file. Also, with saveas function it
closes original file and opens saved as file and I'm trying to have
user stay in original file that was open. Any help will be greatly
appreciated

Thanks
Arthur
 
D

Dick Kusleika

Arthur

You can use the SaveCopyAs method if you want to save a copy of the file and
leave the original open and in its same location. If you can't get SaveAs
to recognize the network address, you won't have better luck with
SaveCopyAs. Likely, you have a typo in your path and it points to a
directory that doesn't exist. You may also be missing a backslash somewhere
in there. If you can't figure it out, post the code and the error message
you're getting.
 
K

knosalaa

I don't have working code as i have tried many options. If my memory
serves me right

sub filesave ()

filename=range("8-dir'!d4")

Workbook.SaveAs filename="W:\Corp...\subdir\filename & format(Now)
mmmyyyy) & "(.xls)"

end sub


as you can see filename only have one cell reference and i need two
where second has date format in different worksheet.

thanks for your quick responce
Arthur
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top