excel vba - something missing in formula?

C

chief

I don't know what is wrong with this. I am trying to set it up so tha
when i click the command button, it will save it to my documents and i
will save the file name as the contents in cell K5.
If it is being used for an invoicing program and the contents of K
will be changing with each transaction, will this code be set up s
that it will keep the original sheet as a sort of template, and onl
save the file each time as the new number that will be generated? doe
that make sense?

Private Sub CommandButton1_Click()
Sheet1.SaveAs("H:\MyDocs\", (Range("K5").Value)

End Su
 
B

Bob Phillips

Try

Sheet1.SaveAs Filename:="H:\MyDocs\" & Range("K5").Value


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top