ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving file to a location determined by a cell (https://www.excelbanter.com/excel-programming/314803-saving-file-location-determined-cell.html)

Dan Hulgin

Saving file to a location determined by a cell
 

Hi,

I am developing a form that updates a database. I would like the user
to click on a button and it will save the file as a name determined b
a cell reference, and save it to a folder as determined by another cel
reference. It also needs to update the database, when it is saved. (
need this so they don't mess things up :))

Currently for saving as a particular filename I have:

ActiveWorkbook.SaveAs FileName:="ETR_" & Range("v7").Value & ".xls"
whe
V7 contains the file name i wish to add
This part works, However, this does not give the prompt to update th
exisitng database, whichI need it to do


I also have the following for saving to a particular location:

SavePath = "G:\Labs\Request Form\Database\" & Range("v32").Value
whe
V32 contains the name of the subfolder

But everytime I run the macro all it does is save the file to
G:\Labs\Request Form\Database\
instead of
G:\Labs\RequestForm\Database\whatever is in v32



Also the form works well if I dont run the macro, it updates th
database just fine and gives the correct prompts.

Any help in this matter would be greatly appreciated

--
Dan Hulgi
-----------------------------------------------------------------------
Dan Hulgin's Profile: http://www.excelforum.com/member.php...fo&userid=1574
View this thread: http://www.excelforum.com/showthread.php?threadid=27256


sir_glen[_2_]

Saving file to a location determined by a cell
 

I'm a novice with macros so this could be completely wrong but it seem
to me that instead of

SavePath = "G:\Labs\Request Form\Database\*"* & Range("v32").Value

it should be

SavePath = "G:\Labs\Request Form\Database\ & Range("v32").Value*"*

I haven't tried that but it's a suggestion...

Also, I'm working on macros to do similar things and have gotten a bi
stumped.

I want me macro to check whether or not the cells it is getting th
filename from actually have anything in them. How would I do this? Do
just put the formula I would use in a spreadsheet to do this

--
sir_gle
-----------------------------------------------------------------------
sir_glen's Profile: http://www.excelforum.com/member.php...fo&userid=1476
View this thread: http://www.excelforum.com/showthread.php?threadid=27256



All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com