Getting Macro To Save In Folder Specified On Worksheet

Oct 8, 2008

I have a macro that currently saves and prints the sheet I'm working on. At the moment, it saves everything in the same place and always calls the file the same name.

In the worksheet, a lookup does actually specify what folder it should be saved in and what name it should be given. How can I write the code so that it pulls up the name and the folder directly from the sheet it's saving?

View 3 Replies


ADVERTISEMENT

Macro To Locate Folder In A Folder And Save

Apr 13, 2009

looking for some code to save to a destination

destination address is
C:Documents and SettingsstDesktopOJF

now the problem is OJF has folders named 1 to 500

so if cell d5 = 487 it will need to look in the above desination and then open the folder and save it there.

View 10 Replies View Related

Using VBA To SAVE Worksheet As PDF To Specified Folder?

Apr 21, 2012

My workbook has a worksheet for reports of sales by each sales person (which I had hoped to send by email). CDO didn't work because I have win7 and no flavors of Outlook and ShellExecute worked but truncated any sales beyond the first dozen. So.... My NEXT plan is to include a SAVEAS pdf for that report worksheet (with 12 or more reccords) using the salesperson's name and saving them all in a reports folder. Then I will go back and manually send those reports as attachments.

View 1 Replies View Related

Save As Macro :: Save File To Folder

Jan 17, 2010

I have a macro that copy one sheet of the Active workbook and sends it via email.

I need to add a code in this sheet so when one opens it from the email, with a command button to be able to save the file to specific, fixed folder on the local network with it’s original file name.

View 10 Replies View Related

Macro To Save As To Specific Folder

Apr 29, 2014

Looking for VBA code to automatically save an excel file as an .xlsx format, and saving to a specific folder: C:UserswolfmDesktopLoad Lists

I have been using the attached code, but it's not working. It saves to the desktop, not the folder. Also, when it creates the file name based on sFile = ActiveSheet.Range("C4").Value & ".xlsx", it adds wierd things to the file name. I want the file name to be simply the value in C4.

View 2 Replies View Related

Macro To Save In Server Folder

Sep 17, 2009

Our small company only has 5 computers in it with mine acting as the "server". I want to put a macro on our customer order forms that all computers can access on the server that will save the file as 3 or 4 cell names serparated by commas and save it in a specific location on the server.

I got the macro to work perfectly on my computer but when I try to type in the appropriate path to the server the file gets saved in their My Documents folder 99% of the time. I did get it to work twice but it seembed to be completely random as it didn't work any of the times before or after.

Here's what I have so far: ...

View 9 Replies View Related

Save Macro - Create Folder If It Does Not Already Exist?

Sep 11, 2012

I have the following code which saves a certain sheet to a new workbook and then emails it to a range of cells. The directory the file is saved in is from a cell, and changes depending on certain cells in the workbook. I would like to make it so if the folder it is saving to does not exist, it will create it. If this isn't possible with this set up, I would just like it to display an error message if the folder is not present.

VB:
Sub Save_Report()
Dim wbName As String
Sheets("TELELINK & ITINERARY FORM").Copy

[Code].....

View 1 Replies View Related

Macro To Save A File To Specific Folder?

Dec 7, 2012

I have a folder called "Report" at C: and inside this folder there are 12 folder named from 1 to 12 ("1","2",...,"12")

I need a macro to save my workbook as a file in C:Report(one of these folders depending on the month of a certain cell)

i.e. if the date in this cell is 8/12/2012 .. then save my file in C:Report12*.xlsm

This is the code i use

Code:
Private Sub CommandButton1_Click()
Dim fname As String
fname = Format$(Range("S8"), "dd-mm-yyyy")
On Error Resume Next
ActiveWorkbook.SaveAs Filename:="C:Reort" & fname & ".xlsm"
End Sub

So what i need now is what to insert after C:Report

View 9 Replies View Related

Macro To Create New Folder And Save File

May 27, 2009

I want to create a macro that will create a new folder called "Fungicide Quotes" under my documents and will save the workbook using the cell reference d4:f4 for the file name, which are merged cells. I have tried the following but can't get it to work. Any help would be appreciated, Thanks

Sub Save_wrkbk()

Dim strFilename, strDirname, strPathname, strDefpath As String
On Error Resume Next
strDirname = "Fungicide Quotes"

strFilename = Range("d4:f4").Value
strDefpath = "C:My Documents"
If IsEmpty(Filename) Then Exit Sub

MkDir strDefpath & strDirname
strPathname = strDefpath & strDirname & "" & strFilename.......................

View 9 Replies View Related

Macro Save Multiple File With Other Names In Same Folder?

Mar 27, 2014

how to save multiple file with other names in the same folder

View 1 Replies View Related

Macro To Save Files In New Folder With Current Month And Date

May 6, 2014

I have this existing macro which saves each tab into a separate excel file. However, I'd like for it to also save them together in a new folder using the current month and date (named: QA Files May_05.06.14). The month and date would change according to current month/date. How would I incorporate that into this code? I am not good with macros.

Sub tabname()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Activate
ws.Name = Range("D1").Value
Next

[Code]...

View 4 Replies View Related

Macro To Save As File To Current Daily Folder, Path Changes

Aug 6, 2008

I have a report send to me daily. And I want to have a macro to save this report in the daily folder, such as “c:

eports8052008”, so tomorrow 's folder would be “c:eports8062008”.

All the daily folders already exist. Just need to change the file path. I tried some codes including sPath and format(now(), “mmddyyyy”), get error message.

View 9 Replies View Related

Macro To Save Duplicate File And Create Folder Name Based On Cell Value

Nov 25, 2009

I currently use the following code to create a duplicate file based on two cells within a directory and folder i specify. These cells consist of the team and week commencing date (mondays date of week which is cell 'Main Menu'!K8)

View 7 Replies View Related

Lookup Folder From Cell Text Then Save Excel File In This Folder

May 14, 2014

I have alot of project folders on my harddrive.

All in format: I:/12345-costumer-projectname/

The five digits are unique for each project.

I make calculations for these projects using an excel file. In this excel I also type the projectnumber (cell J2)

Now i would like to make a button. When pressed, it checks the projectnumber cell J2, looksup the corresponding folder and saves the excelfile in PDF format in this folder.

I have found macro to find files in folders, but none which do the above.

View 4 Replies View Related

For All Workbooks In Folder - Copy Range To Different Workbook - Save To New Folder?

Apr 21, 2014

I have up to 50 workbooks in one folder with data in a specific range. I also have one workbook which includes additional data, including conditional formatting and dropdowns. I need to copy the desired range from the first workbook in the source folder to the second workbook, then save the latter to my destination folder, using the same name as the first. I need to repeat this process for all workbooks in the source folder.

View 2 Replies View Related

Image Folder - Save 500 Images In Another Folder?

Jul 18, 2014

I have a list of items in an excel sheet... 500 of them... and there are images for them in an other folder... The problem is those images are in 1000's and I only need those 500 images.. Images are saved as "SKU.jpg eg NS2354.jpg and we have an SKU column in excel as well .. SKU and their images have same name...

Is there any solution to pick up only those 500 images from those thousands of images?

Is it possible to save those 500 images in an other folder?

View 2 Replies View Related

Use Macro To Insert Same Formula Into Each Worksheet In Same Folder?

Aug 21, 2012

I have a folder for each month, and in the folder there are worksheets for each day of the month. eg for January folder, it will contain 31 worksheets. They all have the same column headings. I want to know if there is any way i can use a macro to automatically insert a formula in each worksheet, using loop?

View 2 Replies View Related

Save Workbook Using Variable For Save As And For A New Folder Name

Jul 31, 2009

I have figured out how to save the workbook using a variable to saveas but I would like to create a new folder to place the new workbook into. I have tried a few things a am not having any luck. I recorded a macro and the code it produced is as follows.

View 6 Replies View Related

Loop Through A Folder And Save In Different Folder

Apr 26, 2014

I would like to create a code that will open all workbooks in folder "A" one at a time and then close the work book after another code is executed. So one workbook will open and while the workbook is open, I will call another code to format the active workbook and then the active workbook will be saved in folder "B" and closed and go to the next workbook in folder "A" to start all over. The folders are saved on the desktop.

View 5 Replies View Related

Macro To Save Shared Addin To Personal Addin Folder

Dec 30, 2008

I have an addin in a shared folder which was created by someone else. (it is a user form). I need to create a macro which will go to its existing folder and then save it in the users personal addin folder also picking up their user id. There will be about 100 users so easier this way than going round doing it for them.

So I suppose the query is three fold.

1, pick up the addin and save it in a personal addin folder.
2, Find the username as part of the path file. For instance my personal would be:

"C:Documents and SettingsO033116Application DataMicrosoftAddIns"

The "O033116" is where I will need a search completed to obtain the user id.

The addin is called ServiceCredt.xla

3, Activate the installed addin.

The reason I want it this way is so the user is unable to access any of the code and we are in control.

View 8 Replies View Related

Save One Worksheet As A .CSV File With Macro

Jan 7, 2010

So I am trying to design a workbook that has two worksheets... one with instructions and a button for users to click to "Save as .CSV File", another for the data that will go into that CSV file.

Here are the Macro requirements:
1. The user will be prompted for the File & Location to save the .CSV file
2. If they click 'Cancel', no changes will be made (and unlike my current code, it won't ask them to debug).
3. Confirmation of the filename is not necessary even though it's currently included in my Macro
4. The file will automatically "reopen" so that they only see the new .CSV file without the original Instruction tab.

View 2 Replies View Related

Macro To Save Copy Of Worksheet

Sep 22, 2011

I have a Workbook with around 10 worksheets on, each worksheet is a form.

And when one form is completed we have to save a backup. So i want to assign a macro to a button on a worksheet so when clicked it will save a copy of that worksheet ONLY to a destination and not all the other worksheets along with it.

View 9 Replies View Related

Macro To Save As Using Path In Worksheet

Apr 2, 2012

The macro is working fine but what I want to change is the path for saving the file. The path that I would like it saved to is in the worksheet "NEW ORDER_" cell "N2"

Sub RENAME2()
Dim strWbKill As String
Dim myName As String
myName = ThisWorkbook.Path & Application.PathSeparator 'copy to same folder that file is in
myName = myName & Application.Cells(3, 7) & "_" 'cell G3 Style

[Code]...

View 5 Replies View Related

Macro To Save Worksheet As Cell Value

Jul 12, 2013

I need a macro that I will be using for a workbook that has many workseets. I need to save a worksheet "Test1" and save to a path found on worksheet "Test2" cell A1 and make the file name the value of "Test2" cell A2.

View 9 Replies View Related

Macro That Will Save Data To Specific Worksheet Tab

Feb 22, 2012

I've been using this macro to pull data from multiple files, but instead of it creating a new tab, how can I have the macro pull the data and save it on a specific tab name(ex. Comp Stores). Here's the code I have currently.

Private Declare Function SetCurrentDirectoryA Lib _
"kernel32" (ByVal lpPathName As String) As Long
Sub ChDirNet(szPath As String)
SetCurrentDirectoryA szPath
End Sub
Sub Combine_Workbooks_Select_Files()
Dim MyPath As String

[code]....

View 1 Replies View Related

Macro To Save Worksheet As PDF - Subscript Out Of Range

Mar 20, 2013

I have code to save an excel sheet as a PDF and attach it to an email but when it try to modify it to save as an excel, it causes errors. Below is (1) the excel code I'm trying to fix; and (2) the working code for my PDF function. When I run the macro to save the excel worksheet in a new workbook, it creates the sheet in the a separate workbooks, but then gives as Run-time error '9': Subscript out of range." When I run debug, the line in red is what's highlighted. So it's not liking something with the filename/path??(1)

Code to save worksheet into new workbook (broken)Sub SaveAsExcel2()
Dim FileFormatstr As String
Dim Fname As Variant

[Code]....

View 3 Replies View Related

Macro Save A Copy Of The Front Worksheet Values Only

Feb 25, 2010

I have a multi-worksheet spreadsheet in excel 2003. I want to produce a macro that will just save a copy of the front worksheet values only. That is I don't want to save any formulas or any of the hidden worksheets, just the front page report, plus it's formatting/layout.

View 9 Replies View Related

Macro To Save Worksheet As Text File Without Blanks

Jan 27, 2009

find attached an example of the spreadsheet I am working with. Please bear in mind that this is a much simplified version of the version I am currently working on (which needs to have 1000 lines). What I am trying to achieve is allow my team to enter rows of data into the spreadsheet in a format that they will be familiar with - then hit the button on the sheet which will then take a copy of the second sheet (which looks up against the first) and spit it out in a .txt file ready to be uploaded into our computer system.

The main priority that I need to fix is that when the .txt file is opened in notepad it contains a huge amount of blank data rows at the bottom - I assume that it is taking accross all 65536 lines into the .txt where I only want the rows that have data in them in the .txt. At present our computer system will not accept the .txt due to all the blank rows (its limit is 1000 lines).

View 5 Replies View Related

Macro For Creating Workbook From Every Worksheet And Save By Value Defined By Cell

Mar 26, 2013

have seen macros that create a seperate sheet & save by tab number etc, & wonder if its possible to save each sheet in a workbook as the value defined in each sheets cell A2. is there a vb macro available to do that ? if so where ?

View 9 Replies View Related

Save In A Particular Folder

Feb 22, 2007

How do I write this to always save in a particular folder? C:Documents and SettingsErinDesktopJob Cost Estimates and how is it different if I am using a shared network?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim varFileName As Variant

varFileName = Application.GetSaveAsFilename(Range("G6"), _
fileFilter:="Excel Files (*.xls), *.xls")

If varFileName False Then ThisWorkbook.SaveAs varFileName

End Sub

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved