Create A Separate File After Macro Done

Apr 19, 2006

How can I code to create a copy of a worksheet in an excel file I am using a macro on, after the macro is done processing? In other words, when the macro completes processing, create a copy of the worksheet labelled "Output", and save it in a directory that the user chooses? Also, would it be possible to create a .pdf file?

View 9 Replies


ADVERTISEMENT

Excel 2010 :: Create Separate PDF File For Each Worksheet - Different Name

Mar 29, 2014

I need to create a separate PDF file for each Excel Worksheet, each worksheet has a different name.

I am using Excel 2010

View 1 Replies View Related

Create Subfiles From Master File Using Key To Split Workbooks To Separate Files

Jun 13, 2013

I am trying to make my macro more dynamic for a spreadsheet I am working on. I have this code which splits out worksheets (using the specific names of the worksheets-not dynamic) from a main workbook into template workbooks (which are basically just an empty workbook because I didn't know how else to do it) and then saves them using the paths below. I would like to make this more dynamic by splitting the different worksheets into new workbooks based on a key column in the hierarchy worksheet.

Basically I have a list of accounts in column B with the file name they should be exported to in column A. There are about 30 accounts being split into 6 different region files. Also note that the same account might be listed multiple times in column A (needed to add multiple numbers for other lookup formulas in the worksheets) but that account worksheet will still only be going to one of the six region files and not to multiple regions. After these are copied to an individual file I would like to save it to a location on my computer. All files will go to this location.

VB:
Sub Create_Subfiles()

Dim FDMName As String
Dim FBName As String
Dim DIYName As String
Dim WMName As String

[Code] .....

View 3 Replies View Related

Macro For Copy Data And Paste In Separate File With Loop Function

Nov 24, 2013

I am trying write code withVBA to save separate file in a different folder with Loop.

Write a code with "loop" till it finds empty cell in the column and for every change in number a separate file needs to be saved in specified folder with file name as "10010, 10011,10012... and so on with data copied in the file saved.

Below is the data.

10010
10011
10011

[Code] ....

View 6 Replies View Related

Macro To Split Excel File Into Separate Workbooks And Automatically Email It

Jan 10, 2014

I need to write a macro to split an excel file into separate workbooks and automatically email our project managers.

View 1 Replies View Related

How To Create Macro To Change Value In CSV File

Aug 21, 2012

I have a CSV file contain many fields and all fields have value (positive & negative values). I have 3 questions here:

1) This file is created on Friday. So the date in Field1 is Friday's date. I want to change the date to Saturday date. How can i change it using macro?
2) I want to set the value for fields 24 until 26 to 0. I want the script to force the field value to be 0. How can i do that by using macro?..and fyi, my CSV file have header in the first row. Below i illustrate my original csv file and the expected output.
3) How can i automate the macro to run every Friday afternoon?

Original csv
Field1, Field2,....,Field24, Field25, Field26, Field27
"20120803","ABC",...,9.032,24.52,-6.325,21.12
"20120803","ABC",...,5.242,-1.53,7.005,21.12

Expected output csv
Field1, Field2,....,Field24, Field25, Field26, Field27
"20120804","ABC",...,0,0,0,21.12
"20120804","ABC",...,0,0,0,21.12

View 1 Replies View Related

Create New File & Name Via Macro Code

Sep 1, 2006

I have been trying to create a macro that creates a new workbook and prompts the user to enter a new filename for it. I'm getting stuck with the code.

View 3 Replies View Related

Custom Macro To Create New File From Data

Jun 12, 2009

I'm looking to create a new file from data in my table. I don't want to even imagine having to do this manually again...I'm optimistic there is a solution. All the data needed to create the file is in the table, but i need it stacked and organized in a weird way. It's almost to hard to explain...so I color coded an attachement that basically says it all. It's pretty much the same thing repeated over and over except the last 2 lines. It's just a really messed up organization. In the real version I need the new file in a new workbook. I'm extremely grateful to anyone who can automate this thing

View 2 Replies View Related

Create A Border Macro When Open The File

Jul 26, 2009

I have recorded a macro which will create the border for me when the file is opened, but it turned out too long. if someone can show me how to reduce the codeing. I have the attached file.

Range A5 to E20 thin Border all sides and thick border allround (16 rows)
Range A21 to E36 thin border all sides and thick border allround (16 rows)

end range is A356.

View 5 Replies View Related

Fixing Macro: Only Create Around 53 Text File

Aug 23, 2009

First need to create a "Text" Folder in your desktop, then try running the macro. It will create a number of text files inside the "Text" folder.. And they contain the used cells from each row. It's supposed to create 982 text files, with the text name referred to the first column. Problem is, if you try running it, it will only create around 53 text file

View 2 Replies View Related

Macro To Create Automatic Backup Of File

Oct 27, 2013

Is it possible to create a macro that automatically saves a backup of the excel document in another desired location?

I have this formula:

Sub backupbutton()
Dim fname
fname = "D:" & Format(Now, "dd mmm yy hh mm") & ".xlsm"
ThisWorkbook.SaveAs Filename:=fname
End Sub

But that just keeps on making multiple copies of the file rather than overwriting the backup in the D: location.

Also, that particular macro requires me to have to click on a button in order for it to work but I would prefer that it happens automatically when the original file is saved.

View 2 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

How To Create And Add Password To Default Windows Zip File Using VBA Macro

Mar 17, 2013

how to create and add password to a default windows zip file using vba excel macro.

View 2 Replies View Related

Need To Embed A Sound File & Create A Macro To Play It..

Jan 20, 2010

embed a audio file (.wav or .mp3) into a Excel Sheet and be able to have it play from a macro? I need the Clip to stay in the file not refer to a location on the pc and have it play from the sheet not open media player. Can this be done?

View 7 Replies View Related

Create & Save Workbook To Same Path As Macro File

Aug 21, 2008

I have code to create a new workbook, and when I try to rename it I get "Compile error: Can't assign to read-only property."

Dim objXlApp As Object
Dim wkb As Workbook
Dim wks As Worksheet
Set objXlApp = CreateObject("Excel.Application")
' Create a workbook
Set wkb = objXlApp.Workbooks.Add
' Delete all worksheets bar the first one.
For Each wks In wkb.Worksheets
If Not wks.Index = 1 Then
wks.Delete

End If
Next wks
'Create some worksheets and names
With wkb
.Worksheets(1).Name = "myWorksheet1"
.Worksheets.Add.Name = "myWorksheet2"
.Worksheets.Add.Name = "myWorksheet3"
.Worksheets.Add.Name = "myWorksheet4"
End With...................................

View 5 Replies View Related

Macro To Create New Line In Inventory Pointing To Specific File

Jul 9, 2014

I created the following macro by recording the macro and going through the steps manually, however I need to make some changes and can't seem to accomplish what I'm trying to do.

The Macro opens a master inventory file, creates a new line, and then links certain column cells in the inventory to corresponding places within the original form (the macro is executed from the original form once it's completed).

Problem is, the macro is written using the form "template" so whenever I save the template as the name of the unique item, it won't update the macro language as well.

What I'm trying to accomplish is when someone opens the template, the save immediately with a different file name, and once the form is completed and the macro is run, it's creating the new line in the inventory pointing to that specific file.

I thought somehow utilizing ThisWorkbook within the macro instead of explicitly using something like

"='[Control Sheets (JOHN TEST).xls]FUND SET_UP PG_1'!R2C3" would accomplish what I'm trying to do.

View 5 Replies View Related

Create Master File With Macro Built In That Will Allow Multiple Users To Use It At Once

Feb 7, 2014

I am trying to create a master file, with a macro built in, that will allow multiple users to use it at once. The macro is to open a dilouge(sp sorry) box showing the contents of a specific folder, allow the user to selct one of the sheets, then copy and paste the set details from the hidden tab on this sheet (All sheets will be the same barring title), append the details to the master list in the first empty row.

I've got this far thus
Sub Macro1()
'
' Macro1 Macro
'
'
' Modify this folder path to point to the files you want to use.
FolderPath = "My Folder name here"

' Set the current directory to the the folder path.
ChDrive FolderPath

[Code] .....

So I can copy the row, but I can't get the first part to open .

View 3 Replies View Related

Macro To Separate File Name And Path From Complete Path

Oct 3, 2012

I want to run a macro to separate File Name and Path from the given complete path

For Example

Code:

In Column A : Given Complete Path " C:MainFolderRecordsSubFilesFile1Record.pdf

I need it separeted like

Code:

In Column B :File Name = Record.pdf
In Column C :File Path = C:MainFolderRecordsSubFilesFile1

Is there any way to do this through a macro

View 2 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

Excel 2003 :: Macro To Create Text File - Runtime Error 91

Jun 18, 2012

When I am running a macro in excel 2003/windows 7 and trying to create a text file, it is giving this error. I am attaching two pictures.

View 1 Replies View Related

Create Separate Columns From One Column

Jun 27, 2009

I have a spreadsheet with these columns:Group_Name
Contact Name
Company Name
Contact ID

Situation:
The Group Name Column has the name of the group that the Contact Name is a member of. The Contact Name could be a member of many Group Names and therefore there may be many rows of the same Contact Name one with each Group Name that they are a member of. I have manually created separate columns for each Group Name in the spreadsheet that is attached.

Goal:
I would like to have a macro that will look at the Group Name column and create a new column for each distinct group. I then would like the macro to go down the Contact Name column (I believe that I will have to have it sorted)and look at the Group Name that is listed in that row and put "True" in the Group Column that was created in the above step. Then, go to the next row, if the Contact Name is the same, look that the Group Name column and put "True" in the corresponding Group Column in the FIRST ROW OF THAT CONTACT NAME. Then Delete that row.

View 2 Replies View Related

Vba To Create Separate Reports From Master

Jun 20, 2008

I have the following spreadsheet Columns on master sorted by Column J:

A--------------E-------------J
SUPPLIER----CARRIER------LOC CODE
BELGIUM-----HAM-----------BP
HYDRO-------MSC-----------BP
DAINIPPON---NNR-----------BP
BELGIUM------YM-----------BR
BELGIUM------YM-----------BR
HYDRO-------MSC----------CA
BELGIUM-----HAM-----------CA
HYDRO-------MSC-----------CA
HYDRO-------MSC-----------DE
DAINIPPON---NNR-----------DE
BELGIUM------YM-----------DE
BELGIUM------YM-----------DE

What I need too do based on the Codes in Column J is create a separate workbook for each different code.

View 9 Replies View Related

Create Separate Worksheets Within Workbook

Oct 28, 2008

I have a table of data with three columns. In the first column I have different values, but they can also repeat. How can I have VB look at my table and for every distinct value in the first column create a sheet with the value name and paste all the data into that same sheet?

View 9 Replies View Related

Separate File Name From File Path

Jun 12, 2008

I am trying to separate a filename from a filepath in Excel VBA 2003.

I am using the Application. GetOpenFilename command to get the user to select the correct file.
However, this also seems to record the filepath.

I am trying to separate the filename out of this so that each file( name) activates a different sub procedure.
I am storing the result of the getopenfilename as a Variant.

At the moment I am having to specify the full path in order to get each sub to run. This is fine for 1 user - but not for others as the files are stored in different locations for each user.

View 7 Replies View Related

Create Separate Sheets For Each Team By Year

Feb 27, 2014

I have a code that will create separate sheets from “SDL_Calendar” sheet for each team and its working fine. Modify the code to create sheets for each Team BY YEAR based on user selection in Cells “H6”, “H7” and “H8” in “P6_Report” sheet. For filtering BY YEAR Column "D" Can be Used in “SDL_Calendar” sheet.

I have attached the work book of what I am trying to accomplish :

[Code] ......

CreateSheetsByYear_new.xlsm‎

View 14 Replies View Related

Create A Separate Function To Sum All The A1's? Below Is An Extract Of My Sub Routine.

Jul 18, 2009

For Each wksht In ActiveWorkbook.Worksheets
i = i + 1
ReDim Preserve wkshtnames(1 To i)
wkshtnames(i) = wksht.Name
x = wksht.Range("A1:B2").Value

Next wksht

View 9 Replies View Related

VBA - Copying Data From Another Sheet And Create Separate Sheets

Feb 24, 2014

I have a workbook with two sheets the first one is called "SDL" contain master data for three TEAMS (TEAM.A, TEAM.B & TEAM.C") and the second worksheet is called "SDL_Calendar" for graphical chart view.

I need Macro to copy the relevant column data from "SDL" sheet and paste into appropriate column in "SDL_Calendar" sheet then make separate sheets for each "TEAM".

I have attached the work book of what I am trying to accomplish.

View 6 Replies View Related

Create Copies Of Items And Their Attributes Into Separate Rows?

Oct 2, 2013

I am trying to take items with multiple market attributes and columnized them so that they can be sorted or filtered.

For example,

Item 110 is suitable for Preteen, Teen, Young Adult, Adult and Senior
Item 121 is suitable for Teen and Young Adult
Item 250 is suitable for Senior
Item 300 is suitable for Young Adult, Adult and Senior

I want to be able to arrange the attributes vertically so that the attributes can be filtered. I'm thinking the easiest way to do it is to duplicate each row as many time as there are attributes and copy each attributes to a single Market column.

View 9 Replies View Related

How To Create Separate Column To Show Total Of Spent For Each Supplier

Jul 26, 2012

I have a column for suppliers names and a total column The suppliers names differ. How can I create a separate column to show the total of spent for each supplier. I'm not up on excel code

View 4 Replies View Related

Create Fillable Pdf File From Existing Excel Xlsm File?

Feb 25, 2014

I have a macro enabled file with some functions. Now I want to create a fillable pdf file from this file.

I am able to create a pdf file from Excel 2007, but not able to make a fillable one

View 1 Replies View Related







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