Save Each Worksheet As PDF File And Name Each File Based On Cell Value In Each Sheet

Jul 10, 2014

I have a Workbook that already has a macro in it that will generate multiple sheets based on certain criteria.

For each of these newly generated sheets (numbered 1-6 in the attached example), I need to be able save each of them to a PDF file based on a unique name contained in a certain cell (in this case, each named is referenced in cell Q1 of each sheet). As such, I should end up with 6 pdfs based on the attached sample files.

The PDFs would ideally need to be landscaped and should be just 1 page per sheet.

In my attached sample workbook, you'll notice that I have a "PracticePrint" macro that doesn't quite get the job done. One other criteria involves not printing any sheet with the characters "1010" in it (my PracticePrint macro is setup to do that, but it fails to do much else).

View 1 Replies


ADVERTISEMENT

Save File Name Based On Sheet Name

Feb 10, 2010

I am currently using a simple macro to save my spreadsheet.

View 14 Replies View Related

Macro To Save Worksheet As New File Then Return To Original File

Mar 14, 2014

I have a macro which successully saves a worksheet as new file to another file path....(below)...but I can't figure out how to close this new file and return to the original file...

Dim myPath As String, fName As String
myPath = Sheets("Date").Range("C8").Text
fName = Sheets("Date").Range("C9").Text
Sheets("Sage CSV File").Copy
With ActiveWorkbook
.SaveAs Filename:=myPath & fName
End With'

View 2 Replies View Related

Macro To Select All Worksheet And Save File As File Name?

Mar 6, 2012

I want to create a macro that will select all the worksheets (names and quantity will vary) and saves the file as the current file's name but in PDF. Since I only know how to record a macro it specifies the worksheet names but I need it for various workbooks. The name will vary plus the number of tabs can go anywhere from 3 to 40.

View 9 Replies View Related

Save File As Pdf Based On Cell Reference A4?

Mar 6, 2014

I want to save my file as a pdf based on cell reference A4.

This is what i have

[Code] ....

View 2 Replies View Related

Save Excel File As Another File Using Current Date As Part Of File Name

Oct 10, 2011

VBA coding for automatically saving an excel file as another file using the current date as part of the file name together with "32ga" as a constant add-in. I also what this macro to run at a particular time of the day let say 00:20hrs. The excel file i want to save as is always open . It has data that changes every 24-hrs.

View 1 Replies View Related

Excel 2010 :: Save Open Worksheet To File And Include Date Of Save?

Mar 11, 2014

am using Excel 2010 and having issues trying to save a worksheet to a specified file location with the save date....

I have tried several posts form this forum and elsewhere and can't seem to get the macro to do what I want.....

I want to save a 'worksheet' from an open workbook that I use for updating information to the same file path as the workbook with the date the file saved...

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

How To Save Worksheet To CSV File

Jul 7, 2014

As a newbie to macros I am having trouble trying to save a worksheet to CSV file. The macro worked to .txt but when I change it to .xlCSV it comes up with runtime 1004 error, method 'save as' of object '_workbook' failed.

Sub Export7400_setup_Click()
'
' Exportsub Macro
'
Dim sPath As String
Dim FName As String
FName = Range("rng7400Filename")
sPath = Range("strWorksheetPath")

[Code]...

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

Download XLS File From Net And Save New Worksheet As Name

Oct 6, 2012

Ticker = "ABC"

I have made a url

[URL] ......

And try to open it

Workbooks.Open(url)

But I get the error

Object does not support this property or method

I am trying to download an xls file, copy the data to a worksheet with the name "ticker" and then close the xls download file

View 3 Replies View Related

Save Worksheet Values Only To New File

Feb 27, 2007

I have a workbook with multiple worksheets. I want to save only a specific worksheet to a new file name and have only the values in the work sheet saved. This particular worksheet references values on another worksheet which uses VLOOKUP to pull data from yet another worksheet. I also want to automatically name the file using a pre-determined name located in a cell reference and save it to a specific location on the LAN drive.

View 2 Replies View Related

Save Worksheet As CSV Text File

May 30, 2008

I am copying a sheet out to a new workbook in order to save as a CSV file. I was wondering if there was a better way of doing this than the code below which uses ActiveWorkbook to determine the newly copied sheet.

Sub test()
Dim OutputFile As Workbook, InputFile As Workbook
Dim sDD As Worksheet
Set InputFile = Workbooks.Open("H:TestTestInput.xls")
Set sDD = InputFile.Worksheets("Data Dump")
sDD.Copy
Set OutputFile = ActiveWorkbook
OutputFile.SaveAs Filename:="H:TestTestOutput.csv", FileFormat:=xlCSV
End Sub..................

View 2 Replies View Related

Macro To Save Workbook By Referencing Cell In Another Workbook For File Name And File Path

Mar 21, 2013

I have got a master workbook and I have written macro to copy and paste data on another workbook. write a macro to save the new workbook to a file path with a file name where both file name and path are stored in master workbook sheet...

View 5 Replies View Related

External File(s) Referenced And File Links Change Based On Row Cell

Oct 22, 2009

I have attached the file I am working on. I am attempting to create a link to an external file based on the value of cells in column A. Then I would like to simply copy the formula down, lets say in Column B, the rows and as I do the external file reference will change depending on the value within the cell in Column A. I hope that I am making sense.

I am using Windows Vista with Excel 2007. The files will all be within the same file folder, however, there are hundereds of files so I won't be able to open them all for the indirect to work.

View 9 Replies View Related

Copy Worksheet And Userforms And Save File As Specified Name

Jan 21, 2010

I have this macro I recorded and pieced together from info I found on the net. It works the first time you run it but then it dies because the next new workbook is not "book1" what I would prefer is to have it save the new workbook as the value of sheet2 F2 and "Product Bulletin" so it would look like "##### Product Bulletin" but I don't know how to write it.

View 6 Replies View Related

Save Selected Worksheet Into Individual File Vba

May 23, 2006

The idea was to save the the selected files specified in the array as individual files. For example, In the Workbook "Main", there are worksheets "Susan", "Mary" and "John". If i specify "Susan" and "Mary" in the array, it should output only these 2 individual files. However, I am only getting the file which is actively selcted in the main. Is there anything wrong with the for loop?

Sub SaveShtsAsBook()
Dim Sheet As Worksheet, SheetName$, MyFilePath$, N&
Dim ws As Worksheet
MyFilePath$ = ActiveWorkbook.Path & "" & _
Left(ThisWorkbook. Name, Len(ThisWorkbook.Name) - 4)
With Application
. ScreenUpdating = False
.DisplayAlerts = False
' End With
On Error Resume Next '<< a folder exists
MkDir MyFilePath '<< create a folder
For Each ws In Worksheets(Array("Mary", "Susan"))
SheetName = ActiveSheet.Name
Cells.Copy..............................

View 2 Replies View Related

Open Text File Into Worksheet & Save As .xls

May 14, 2008

I have a folder that has a bunch of text files in it with numeric names (they are store numbers 2, 3, 165, 188, etc...). I need to open those files (in excel), run a macro on them (this portion of the macro has already been created), and then save them with the same name as the txt file but in an xls format and close. It would be great to have the whole folder process automatically but I am willing to start small. Further, I'd like it to not ask for a filename, and I don't want to see the SaveAs dialog box. So far I have been able to get the macro to run through the my processing of the text file all the way to the SaveAs portion, but the code in my macro opens the SaveAs box and puts the filename of the txt file in the file name box in quotes with the txt extension. Below is the code.

Sub Macro3()
sFile = Application. GetOpenFilename( _
fileFilter:="Text Files (*.txt), *.txt", FilterIndex:=1, _
Title:="Open Workbook")
Workbooks.OpenText Filename:= _
sFile, Origin:= _
xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= Array(Array(0, _
1), Array(5, 1), Array(26, 1), Array(35, 1), Array(39, 1), Array(46, 1), Array(51, 1), Array _
(58, 1), Array(75, 1), Array(87, 1), Array(91, 1), Array(97, 1), Array(99, 1), Array(111, 1) _.....................

View 5 Replies View Related

Save Sheet As A File

Mar 16, 2008

I have excel file which has got 3 sheets.

I renamed the 3rd sheet as "Audit Sheet"

I want a macro to save only this sheet3 "Audit Sheet" as a new file in "my documents folder" but the name of the file should be as follows

The sheet3 has this values..
Cell B1 has value " George"
Cell D1 has the value "Week 1"

The name of the file should take value enterd in B1 ( that is George) and value in D1 ( Week 1") so the file name should be "George Week 1".

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

Save Single Worksheet As File Named From Range

Jun 18, 2007

About 2 weeks ago Reafidy posted a reply to the following thread. Save Individual Sheet Based On A1. As I do not want to hi-jack anyone elses thread so I am starting a new one. The code posted does basicly what I need however I was wondering if it is possible to save only "ONE" specific sheet which could be specified in the code, to a specific folder specified in the code and under a name defined by a cells contents. eg.

Save a single sheet named "MatData" from a workbook, name the saved sheet from a "named range on sheet1" & "Cutlist" & ".xls"
to a Folder on the "D" drive called "Saves"

View 3 Replies View Related

Save To File Single Sheet Only

Mar 21, 2012

There are multiple tabs in my workbook ("Template", "Database", and "Summary"). I would like to add a "Save to file" button on the "Template" sheet and it will dump a copy of this sheet only using the data on cell C4 and C7 as filename, not the entire workbook.

View 9 Replies View Related

Save File To PDF - Only One Sheet Appears?

Mar 3, 2014

I have six sheets in the work book, but one of them spills on to more than one sheet. If i print it or use print preview it displays all the sheets but when converting to pdf with below code only one sheets worth appears, then it displays the next sheet in the workbook, how to amend this so that if it spills over it all converts to pdf

The worksheet in question has 2,000 plus rows, and depending on what the end user selects, it can contain anything between 15 and 300 of those rows (it is a picking list). i currently have it set so that it prints to paper with five different sections for various product types and a summary page, each section has a named range and i have assigned macros to buttons such as immediately below.

Sub printoutsummary()
Range("printsummary").PrintOut
Range("printreturn").Select[code]......

View 5 Replies View Related

Save Excel Sheet As PDF File ()

Mar 15, 2006

I've been working on this problem on and off for a number of months now and have just about got it sussed so thought I'd share it with you as it has mostly been down to postings on this board that I've got it in the end.

Thanks especially to 'biggoan' for his post: http://www.mrexcel.com/board2/viewto...136&highlight=

Anyway, this seems to avoid the need for a class module but does need you to install the Acrobat Distiller object references in Tools...References in the VBA editor.

You also need to go into the printer properties of the your Adobe PDF 'Printer' and under Printing Preferences...Adobe PDF Settings deselect the Do not send fonts to "Adobe PDF" option. Why, who knows!

Private Sub Create_PDF()
'Created by Dom Hill with considerable asistance from Biggoan and Mr Excel

Dim tempPDFFileName As String
Dim tempPSFileName As String
Dim tempPDFRawFileName As String
Dim tempLogFileName As String

Sheets("Sales Data").Activate

tempPDFRawFileName = "C:" & Range("A1").Value

'Define the postscript and .pdf file names.

tempPSFileName = tempPDFRawFileName & ".ps"
tempPDFFileName = tempPDFRawFileName & ".pdf"
tempLogFileName = tempPDFRawFileName & ".log"

' Print the Excel range to the postscript file

ActiveSheet.PrintOut Copies:=1, preview:=False, ActivePrinter:="Adobe PDF", printtofile:=True, Collate:=True, prtofilename:=tempPSFileName

'Create PDF File

Dim myPDFDist As New PdfDistiller
myPDFDist.FileToPDF tempPSFileName, tempPDFFileName, tempShowWindow

'Delete PS File
Kill tempPSFileName
Kill tempLogFileName
End Sub

Not sure why the macro creates a log file but if you know more about VBA then you probably would.

View 9 Replies View Related

Open Website - Download CSV File / Save As In Specific Folder Under Different Name And File Type

Jul 6, 2012

I am trying to open a website, then for excel to download the csv file, then for it to save it in a specific folder under a specific name and file format (excel).

I am successful at opening the website with the following code, but how to do the rest.

Sub Searchez()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://quote.morningstar.ca/Quicktakes/stock/keyratios.aspx?t=clwr®ion=USA&culture=en-CA&ops=clear" 'load web page google.com
IE.Visible = True
While IE.Busy
DoEvents
Wend

'IE.Navigate2 "javascript:SRT_keystuts.exportcsv()"
'this is the name of the download link as from when i hover my pointer over download link.
End Sub

View 1 Replies View Related

Date Function- Open A File, Make An Exact Copy And Save It Under A New File Name

Jun 4, 2009

I'm working on the following
Workbooks.Open Filename:= _
"D:CommondataIBMmainBRANCHBURG-PRODUCTS-BOM-ALUMINUM-UPDATE-" & Ucase(Format(DateAdd("y", 0, Date)), "YYYY-MM-DD")&".XLS"
ChDir "D:CommondataIBMmain"
ActiveWorkbook.SaveAs Filename:= _
"D:CommondataIBMmainBRANCHBURG-PRODUCTS-BOM-ALUMINUM-UPDATE-NAFTA.XLS", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close

Date: 2009-06-03

What I'm trying too do is open a file, make an exact copy and save it under a new file name.

My problem is in the date formula the day is not always the same. In the sample case it's 03 at other times the day will change.

is there a way too get this too work irregardles of what the day might be?

View 9 Replies View Related

VBA Code To Require Fields - Temporarily Save File Email It Then Delete Temp File

Apr 9, 2014

I have a spreadsheet where I want to require certain fields to be completed then I want to have that file auto emailed. I have learned that I do need to have the file saved before sending otherwise the data will not appear in the email, so with this I want to have the file temporarily saved emailed then the temp file deleted.

Here is the code I have so far but it errors on the blue text, I did change the TempFileName from = "Copy of " & wb1.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss") to = [C16] & "_" & [B6] & "_" & [D6]

Private Sub CommandButton1_Click()
If Range("B6").Value = "" Or _
Range("d6").Value = "" Or _
Range("f6").Value = "" Or _
Range("E9").Value = "" Or _

[Code] ......

View 1 Replies View Related

Excel Not Allowing To Save File With Uppercase Letters In File Name?

Jan 27, 2014

A co-worker of mine is exporting files from Quickpen as excel files, but every time he names the files with any Uppercase letters in the files name, they are automatically changing to all lower case. Even when he tries to rename the files, they will not stay with any uppercase letters....I have searched all over and cannot find a solution. If he sends ME the file, I can open it in excel and save it with any cases.

View 2 Replies View Related

Extract Each Sheet To Text File & Save As Sheet Name .txt`

Jun 9, 2007

provide me a code for extracting data and outputting it into individual worksheets situated within the excel workbook file. I am wondering what the code would be if the data were extracted to individual text files, individual workbooks or *.prn files?

For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
Set ws = Worksheets.Add(After:=Worksheets(Worksheets.Count))
ws.Name = wsraw.Cells(i, "D")
With ws
.Range("A1") = wsraw.Cells(i, "D")
.Range("A2").Resize(2) = wsraw.Cells(i, "A")
.Range("B2").Resize(2) = wsraw.Cells(i, "B")
.Range("C2") = 0
.Range("C3") = 1000
.Range("A4") = -999
End With
Next

View 2 Replies View Related

Open File To Specific Sheet Other Than Last Save

May 15, 2007

If i have a sheet with multiple tabs can I somehow make excel open that file on a particular tab rather than the tab that the user was on when they saved/closed it.

View 9 Replies View Related







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