Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

[RESOLVED] How to change the location for saving your files and name your file to a cell?

$
0
0
Hey guys,

This is the first time I work with Visual Basics, so I am not an expert at all.

I have to save several files into 1 folder ("C:\Users\Yves.Vercalsteren\Desktop\files")
But the files need to be named to a specific cell. (because they will be used by a database, and this database searches the files on their name.)

I was already able to change the location of where the file is saved and I can also link the file name to a cell.. But at this moment I'm not capable of choosing the right folder and giving it the right name.
This is what I have at the moment:

'save file

filename = Sheets ("blad1").Range("A2").Value
Filepath = "C:\Users\Yves.Vercalsteren\Desktop\files"
ActiveWorkbook.SaveAs filename

With this formule, it gives the file the right name.. But doesn't give the right location.

I hope someone can help me out..

Thanks in Advance!

Yves

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>