excel vba - something missing in formula?

  • Thread starter Thread starter chief
  • Start date Start date
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
 
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)
 

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

Back
Top