Replacing a subdirectory name in a macro

  • Thread starter Thread starter Alab
  • Start date Start date
A

Alab

I am currently running a macro that every time I run the macro I have t
replace the name of a subdirectory that a file is saving to. Is ther
anyway I can name a cell in ecel that has the subdiectory's name store
in it, and get the macro to accept that name in the address that th
file is being saved to
 
Hi,
Dim TodaysFolder as String
TodaysFolder=cells(1,1).value 'cell A1. You should add the workbook & sheet
names to make 'sure it's the right one

ThisWorkbook.SaveAs "c:\thisfolder\andthatfloder\" & TodaysFolder &
"\filename.xls"


--
John
johnf 202 at hotmail dot com


| I am currently running a macro that every time I run the macro I have to
| replace the name of a subdirectory that a file is saving to. Is there
| anyway I can name a cell in ecel that has the subdiectory's name stored
| in it, and get the macro to accept that name in the address that the
| file is being saved to?
|
|
| ---
| Message posted
|
 
John,

Thank you very much. The VB lines worked great.

If I wanted to do a column of cells with different dates instead o
just one cell that is being referenced, would I do an array? exampl
cell A1 content TodaysFolder, cell A2 content TomorrowFolder, cell A
content NextDayFolder

I would like for the macro to save with A1, then next time save wit
what's in A2,et
 
Back
Top