save file as cell value

  • Thread starter Thread starter Birilac
  • Start date Start date
B

Birilac

Hi, Need to save the file I am working on as the value in one of the cells
(Cell value changes)


Example. The value in cell b109 is "JohnDow"

I would like to save the file as JohnDow.xls without having to look at
the value in b109

Thanks for the help

Tom
 
Option Explicit
sub Testme()

dim fname as string
dim pname as string

pname = "C:\whatever\you\want\here\" '<-note the final \

with activeworkbook
fname = .worksheets("sheet1").range("A1").value & ".xls"
.SaveAs Filename:=pname & fname,fileformat:=xlworkbooknormal
end with

end sub
 
Hi Dave
Thanks for the response and help.
As a new user I am a little lost. Where do I put this Option Explicit
.......end sub

Sorry to be a nuisance
Thanks again
Tom
 

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