Save File Name Based On Sheet Name

Feb 10, 2010

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

View 14 Replies


ADVERTISEMENT

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

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

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

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

Auto Save File Name Based On Time Of Day

Jun 1, 2012

I have a file that will successfully save every 10 seconds.

I want this file's name to change based on what time of the day it is

for example from 630-230pm i want the file to include "day"
230-1030pm include "swing"

this is the code i have

Code:

Dim newFile As String, fName As String
On Error GoTo backup
If Hour(Now()) > 14 And Hour(Now()) < 23 Then
newFile = Format$(Date, "mm-dd-yyyy") & " " & "swing"
Else
newFile = Format$(Date, "mm-dd-yyyy") & " " & "day"

backup: newFile = Format$(Date, "mm-dd-yyyy") & " " & "dayerror"
End If

It currently returns the backup....

View 2 Replies View Related

VBA To Save Single Sheet As Tab Delimited Text File

Jun 5, 2014

Is there any way to write a macro that will take a specific sheet in a workbook and save it as a tab-delimited text file?

View 1 Replies View Related

Save Each Sheet As A Text File With Incrementing Names

Apr 21, 2008

Want to do something *almost* exactly like a previous post but that post is now closed. Extract Each Sheet To Text File & Save as Sheet Name .txt` I want to extract data from individual worksheets from a workbook in excel to individual text files with the **same name as the original excel file** plus incrementing suffix.

Example: File_Name.xls with worksheets: Sheet1, Sheet2, Sheet3
==> Result...... File_Name_01.txt, File_Name_02.txt, File_Name_03.txt

don't delete - this is not a duplicate post. Previous code 1) creates text files with "sheet name" as was the original post's intent (not "file name") and 2) it does not iterate through each sheet (only processes Sheet1 regardless of selected sheet in the workbook)

Sub wsToText()......................

View 3 Replies View Related

Copy A Sheet Into A New Book And Save File Name As The Current Date

Jul 5, 2009

I have an excel file which I use when I book keep journals in work. Each time I come across a new piece of bookkeeping I add to the file, name the sheet and index it. (I've attached a loose example for illustration) so the bookkeeping template.xls gets bigger every day.

Currently, when I book keep on a particular day, I open the template.xls workbook;

draft my journals;

and then manually copy the worksheets I have completed during the day from the template.xls workbook and paste the sheets into a new book and save the days bookkeeping as the current date.

With the file I have attached can someone show me how to write a macro and apply it to each of the buttons on the various work sheet tabs (each button will run the same macro).

Upon clicking a button, I would like the macro to;

Copy the active sheet into a new book and save the file as the current date.

Each subsequent click of a button the macro will check if the .xls file exists for the current date, if it does, then it will just copy the active worksheet to the file that has already been created.

In the new file which is saved as the current date, I need to remove the macro button and the hyperlink that reads back to index.

I have had some helpful macro's provided from another forum, however, the other forum does not appear to enable users to upload files, so I can't quite convey what it is I am trying to achieve.

View 14 Replies View Related

Save As Based On Other File Dates In Names. Increment Number In Name

Mar 4, 2008

How would I save a file with the lastest version number after searching for the lastest filename in a folder and adding 1 to the name

ActiveWorkbook.SaveAs FileName:= _
"C:BarkingEMCOUTNOM_DA_" & (Format( Date, ddmmyy)) & "_EDF_BPL_" & V, FileFormat:=xlCSV

where V will be the version number in the format of 001, 002, 003 and so on

View 7 Replies View Related

Macro To Save Excel Sheet As Comma Delimited Text File?

Apr 21, 2014

providing a macro to save an excel sheet to comma delimited txt file. Also, My sheet has 1st row as table columns and i dont want to export them in my txt file.

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

Save Individual Sheet Based On A1

May 22, 2007

I have a workbook which consists of difference worksheets that downloaded from the system, e.g Jac01, JKen01 and so on. the worksheets' name might varies and from month to month basis. Therefore, just wondering is that a fast way to save the individual sheet as a separate workbooks. The rational of saving the worksheets into individual workbook is mainly for the individual division manager to study their respective product sales.

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

Excel Save As Should Default File Save Type To XLSX Using VBA

Aug 21, 2012

What I am trying to do is that I have an excel file with macros and it is a read-only file. In order for the user to save, I want them to only be able to save as a .xlsx file as it disables all macros. If for whatever reason, the user wants to save the file as another .xlsm file, they should be allowed but before they save, a "are you sure you want to save as .xlsm?" message should pop up.

All the options in the save as box should still be available in case they want to save in that particular format. Just that the .xlsx should be the default.

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

Creating SQL File Based Of Cells In A Sheet

Mar 27, 2014

I have a sheet that has 5 columns as shown below, xxx represents the values within the cell that I need in each sql file.

A |B | C| D| E
test1|xxx|xxx|xxx|xxx|
test2|xxx|xxx|xxx|xxx|
test3|xxx|xxx|xxx|xxx|
test4|xxx|xxx|xxx|xxx|
test5|xxx|xxx|xxx|xxx|

What I am trying to do is take the context of each cell starting with B2, and place it in an Individual sql file (or text file with .sql extension) and name it A2 (so test1 in this case).

I tried creating a double for loop, one for last column, one for last row, taking each content and placing in file but I am not sure how to take the column A as the name of the file and to have 1 file per cell.

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

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

VBA (Save As) No Error But File Does Not Save

Oct 10, 2011

I have written the following simple macro to import some data into a worksheet and then prompt the user to save the file in Excel 2003 format (the system to which we will upload this data does not accept formats later than 2003). The template is in "*.xlsm" format.

The code executes without error, but when the user hits the "Save" button in the "Save As" dialog box, nothing happens. The "Save As" box closes, but no file is saved.

Code:
Private Sub cmdImportData_Click()
Dim sFName As String
'On Error Resume Next
PrepData
CopyData
FormatColumns
'prompt the user to save the file in "*.xls" format
sFName = Application.GetSaveAsFilename("upload", "Excel files (*.xls), *.xls")
End Sub

View 3 Replies View Related

How To Set SAVE AS File Name To Equal A1 Contents When Rename File

Oct 19, 2005

How can I set the SAVE AS file name to equal A1's cell contents? (More specifically, when I need to rename an existing open file and place my cursor in A1 and hit Save As, I need to new file name to automatically populate A1's cell contents so I don't have to retype the contents of A1.)

View 1 Replies View Related

How To Save File With Correct File Extension (XLS Or XLSX)

Mar 12, 2014

How can I save worksheet from existing workbook as a new workbook with extension .xls or .xlsx depending on the version of Excel on which the original was opened and no matter the extension of original?

My code that I was trying to create all above does not work, because even if I am using Excel 2007, 2010 or 2013 it will still be saving only as .xls.

View 2 Replies View Related







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