Add month to file name in VBA

P

phil Rutter

Hello ALL
How can i add a month name to a file name using VBA?
Current code looks like this

Name "C:\Documents and Settings\phil\My Documents\PDF
files\AutoSave\ATB.pdf" As "C:\Documents and
Settings\phil\My Documents\Statistics-WSP\ATB\ATB-10.pdf"

When i try to add the following & MonthName(Month(Date) -
1, False)
it adds the text to the file name
if i remove it from the "" it adds it After the .pdf
statement which then PDF does not reconize?
 
C

Cheryl Fischer

You could try ...

"C:\Documents and Settings\phil\My Documents\Statistics-WSP\ATB\ATB-" &
Month(Date) & ".pdf"

hth,
 

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