save as -- file name from diffent cells

  • Thread starter Thread starter Nilz-p
  • Start date Start date
N

Nilz-p

i need a macro code quick "excel"


it gos to differnet cells
a1 a3 a5

a1 is 2004 a3 is month a4 is a name


it then makes a file name - and then saves as

2004-month-name.xls

(summary)
it gos to the diffent cells picks up the text and creats a file name
and saves it ................ it should look like the above file name
sample

i know how to do it with 1 cell .... but i need to do it with 3
differnt cels u get me

i dont want help ..... i want the actule code ... i dont no nothing
about programing u see....

thanx
 
Hi
try
sub save_date()
Dim fname
with worksheets("sheet1")
fname = .range("A1").value & "-"_
& .range("A3").value & "-"_
& .range("A5").value
fname = fname & ".xls"
ActiveWorkbook.SaveAs Filename:=fname
end sub
 
yo thanx for your help man real aprishate it

but it dont work

fname = .range("A2").value & "-"_
& .range("c2").value & "-"_
& .range("g2").value

the code above is hilited in red wats rong with it ... i changed th
code a bit ... but it had an error from the star
 
Hi
missing spaces. make this
fname = .range("A2").value & "-" _
& .range("c2").value & "-" _
& .range("g2").value
 

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