Macro For All Selected Sheets Into One PDF File

Nov 24, 2013

I'm looking for a string of code that will prompt the user to check-off boxes specifying the sheets they'd like to print, then have it save into a SINGLE pdf file. I'm using the below code right now and it will prompt check-boxes, and print using PDF but it does it one sheet/one PDF at a time. Any way to mod this so it will combine and save into a single PDF?

Sub SelectSheets()
Dim i As Integer
Dim TopPos As Integer
Dim SheetCount As Integer
Dim PrintDlg As DialogSheet
Dim CurrentSheet As Worksheet
Dim cb As CheckBox
Application.ScreenUpdating = False

[Code] ........

View 2 Replies


ADVERTISEMENT

Macro To Print Selected Sheets ...

Mar 16, 2009

in creating a macro so that I can print from sheet 1 to sheet name "XYZ" as an array. In other words I want to print selected sheets as one command so that page number in the footer will automatically change.

View 14 Replies View Related

VBA - How To Import Selected Text File To Temporary Worksheet Using Macro

Aug 5, 2013

Below is the code I currently use to do the following which creates service reports.

When you click on the command button you can choose any XML file you want to import. This file is copied to a temporary worksheet where i selectively choose cells to populate textbox's which later populate my reports. What I want to do is the same exact thing but with a text file. Not all text files are the same length so it needs to be able to have a range. Here's my working code.

For Each SheetName In Array("Maintenance Data Sheet")
With Sheets(SheetName)
.Range("B127") = ""
.Range("U127") = ""
.Range("AJ127") = ""
.Range("AV127") = ""
.Range("AY124") = ""

[Code]...

Cancel:

MsgBox "No XML Selected"
End Sub

View 1 Replies View Related

Getting File-path From Selected Input File

Jan 29, 2014

getting full file path from selected input file?

I have a macro with text box and browse button.

User can click on browse button and it will allow them to select only text files.

Now for further processing I need to get the file path and file name in 2 different variables.

Like if user selected C:/Temp/Test.txt

Variable 1 should have C:/Temp
Varialble 2 should have Test.txt

View 2 Replies View Related

Sum On Selected Sheets

Feb 12, 2008

I have a worksheet that has data for separate sheets for each date of the month.

Therefore, the month of January has sheets for 31 days.

I need to sum a particular cell in each sheets only for Monday.

Therefore, I need the formula to sum cell B4 only for the sheet for Jan 7, Jan 4,Jan 21 and Jan 28.

View 9 Replies View Related

Copy Data From Sheets In Workbooks In Folder To Main File Sheets Of Same Name

Aug 29, 2008

I would like to use VBA to search a folder and copy data from tabs within the excel files there. The data will be pasted to a tab of same name in the the main file. All the files are in the same format.

So far I have only managed to list the files in the folder using code I found on your site!

View 7 Replies View Related

Search Only Selected Sheets

Feb 1, 2007

I'm probably asking something very complicated in coding but I
was hoping someone could give me a macro code that would do a search
for a cell's input, but only search selected sheets.

example: "Please enter the word you are searching for here, and click the enter button:"

'here' would be cell C20. the value of cell C20 would be searched for on various
selected sheets written in the macro only.

View 12 Replies View Related

Copy Selected Sheets

Dec 18, 2008

I use the command ActiveWindow.SelectedSheets.Copy to copy selected sheets into a new workbook. As a result of this line is a new workbook created and a the selected sheets are pasted into the new workbook. Is it possible to paste only values by using a single line like this?

View 2 Replies View Related

Rename All Selected Sheets (For Each)

Apr 8, 2009

how I can change this code to apply to only the sheets that are selected (grouped) as opposed to every sheet in the workbook?

For Each shName In ActiveWorkbook.Sheets

View 9 Replies View Related

Email Selected Sheets Via Userform

Apr 3, 2014

I am trying to set up something similar to the old "print dialogue" box whereupon the user presses a command button on the userform and all sheets within the work book are listed (eg:sheet1, sheet2 etc) The user can select any amount of sheets and and using "OK" outlook is fired up- pretty similar to Ron de Bruins code for email.

I have tried taking the print dialogue vba and stooping it at copy, then trying to gets Ron's code to continue- without success.

There are great bits of code I've seen for select tabs and selct sheets from listbox, but I have found none to email once selected.

View 4 Replies View Related

Copy Selected Sheets To New Workbook

Jan 25, 2009

I have a workbook with about 25 sheets. All the sheets are named. I'd like either a Macro or some VBA code whcih, when the user clicks a button will Unhide selected sheets, say "Equip Labor", "Equipment", Proj. Summary" and "Implementation Guide" and then copy these sheets into a new workbook created on the fly (Book1.xls) and then in the original workbook re-hide all the selected sheets. This way the user can save the new workbook as whatever name they want.
Is this possible? The closest post I could find was this:
http://www.mrexcel.com/forum/showthr...opy+Worksheets
I tried to modify this, but I'm not that good yet with VBA.

View 9 Replies View Related

Refresh Queries On Selected Sheets

Aug 4, 2009

I was wondering if there was a way to Refresh Queries on a sheet by sheet basis. I have several sheets of queries, and I would like to refresh all of them except one or two.

The only way I know how to do this is to stick a line of code for each query into the script while leaving out the queries I don't want. I was hoping there was a more elegant way to do it. If not, no big deal. I'll just do it the old fashioned way.

View 8 Replies View Related

Copy User Selected Sheets

Jun 5, 2006

how you would write a macro to move a selection of sheets to a workbook called Digi's in the D drive. Also if there isn't a Workbook called Digi's already it needs to add one. I've found some code to loop through sheets but nothing to show what sheets the user has selected

View 4 Replies View Related

Process Sheets Selected From Listbox

Nov 17, 2007

I have a workbook with roughly 25 sheets, each sheet represents a customer. Each month, I want to be able to run a macro in the workbook that will produce a UserForm containing a Listbox of each unhidden customer (worksheet) in the workbook. After I select all of some of the customers, hit a "process" button which will run a macro on each of the selected customers from the UserForm one worksheet at a time.

I currently have code written to produce the UserForm and populate the list, but I am uncertain how to write the code for the "process" button to run the macro on each selected customers one at a time. All I know how to do is have excel select all the chosen customer worksheets all at once.

View 8 Replies View Related

Excel Unhide Sheets When Check Is Selected?

Sep 19, 2013

I am trying to create a spreadsheet which will open with sheet1 showing 'Terms and conditions' with 2 check box's. Once the check box's are checked I then want subsequence sheets to unhide. E.g check box 1 ticked - will unhide sheet 2 - (containing the report) check box 2 ticked - will unhide sheet 3 - (containing the data)

Basically, by the use of check box's I am trying to get the user to read and agree to terms/disclaimer of the use of data. Therefore can the workbook also always open with the one sheet 'terms and conditions' showing only.

View 2 Replies View Related

VBA - Apply A Code To All Selected Sheets To Group

Feb 24, 2014

I would like to group some columns to all the sheets that I will have selected. Unfortunately the below code only apply the code to the sheet I am looking at.

Code:
Sub Group()
Dim ws As Worksheet

For Each ws In ActiveWorkbook.Worksheets
With ws.Range("F:Q").Group
End With
Next ws
End Sub

View 3 Replies View Related

Pulling Data From Sheets If Certain Name Selected In Dropdown

Mar 29, 2014

I am creating an excel workbook for my consignment store to keep track of sales for the store as well as the consignors. I have a sheet for each day of the month, and in the sheets I have it to where I can select the consignor from a drop down box. I am trying to create a sheet at the end of the workbook that would allow me to use the drop-down list to select a consignor and have it pull the sales for the month onto that sheet, an end of the month summary of sales. I don't mind creating a formula for each day. IM taking my time on this to make it work the way I want it to. But I cannot figure out how to make it reference that through the drop down box. Consignors name may not be in the same spot each day and might not have sales for that day.

At first I was thinking an IF formula, but how to do an IF for a range of cells from one sheet and have it pull the sales from that same sheet.

View 6 Replies View Related

Print To PDF Selected Sheets From An UserForm Listbox

Jun 13, 2006

I have created a custom Menu (excel add-in) to make my work easy in excel. My problem is to print only selected sheets from Workbook in one PDF file, for that I've created a Userform with 2 listboxes, add sheet and print buttons. In the first listbox are listed all the sheets and in the second listbox are the sellected sheets to be printed. What I've succeded so far is to print selected sheets, but it creates one PDF file for each sheet, only if I put my code in workbook and not in Menu add-in (.xla file). As PDF Printer I use PDF reDirect Pro v2.

View 8 Replies View Related

Compare And Update Selected Data On Two Sheets

Feb 7, 2007

Each monday i get a new price list from our supplier. My job is to compare this list with ours and update if neccesary. The reason, why I'm writing here is simple -I need to automate the process. Since their and our pricelist is somewhat different, it's only possible to use selection comparison. So, I need something that can do this:

1. First I open those two files and make a selection on both of them (like all the apples on the supplier list and all the apples on our list)
2. Push a button that executes a code
3. The code compares a value in the first column
4. If it finds a match, compares the data in second column
5. If data is same, color the cell (or the text) lets say yellow
6. If data is different, update field in our pricelist and color the cell (lets say red), so I can find and recheck it later
7. If the supplier has a _new_ product, the code will insert it somewhere in our list. Doesn't matter where, it may as well be a new sheet
8. Compare the next cells in selected area

View 2 Replies View Related

Hide/unhide Selected Range In All Sheets

Aug 10, 2007

I have several workbooks, and the workbooks can include several sheets. Is there's an easy way to create a macro so the user selection to be hidden or unhidden is hidden or unhidden in all sheets in the workbook. E.g. if the user selection is to hide rows 54-189, the macro hides rows 54-189 in all sheets in the workbook.

View 2 Replies View Related

Save The Selected File

Sep 12, 2009

I want to build a macro that saves all the selected files in a list to a chosen folder from the user.

The user should be able select a range of columns, lets say F13:F20 and press a button "Save as.." and then choose where to save the files.

I attached a dummybook.

View 4 Replies View Related

Open The Selected File

May 30, 2007

Public Sub Populate()
Dim lawSheet As Worksheet
Dim achSheet As Worksheet
Workbooks.Open ("\bankrec recsACHACH.xls")
Set lawSheet = Workbooks("Lawson JE Upload Template.xls").Worksheets("Input")
Set achSheet = Workbooks("ACH.xls").Worksheets("ACH")

to be able to select the "achSheet". The file will need to be selected from T:ACH. This code is over my head and I'm hoping just the beggining can be edited as to not jack up the rest. If I have to paste the code I will. its big but not huge.

I have this that I use on a completely different workbook that lets you select the file, but I don't know how to "make it work" with this application, but the idea of selecting the sheet is what I want.

Dim OpenA As Workbook, OpenB As Workbook
Dim TheFile As String

Set OpenA = ActiveWorkbook

ChDrive "E:"
ChDir "E:QueriesComp Store SalesMicroStrategy Comp Store Reports "

TheFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , "Select the file and choose open.")
If TheFile = "False" Then
Exit Sub
End If
Workbooks.Open Filename:=TheFile

View 9 Replies View Related

Hide Selected Sheets And Not Unhide Without Entering Password

Mar 18, 2014

I want to hide selected sheets and when i want to unhide them, ask for password to unhide the sheets.

View 10 Replies View Related

Copy Selected Cell To Another Worksheet Instead Of Sheets (Interior)?

Dec 24, 2011

How do I copy the selected cell to another worksheet instead of sheets("Interior") ?

Code:
Private Sub OptionButton1_Click()
With Range("B19")
.Font.ColorIndex = 3
.Copy Destination:=Range("P19")
Application.Goto Sheets("Interior").Range("C20")
End With
End Sub

View 3 Replies View Related

Export Selected Sheets To New And Save But Ignore Formulas

Mar 28, 2007

I borrowed the macro below from this forum. My formulas in the sheets I'm copying refer to other sheets that I'm not saving. can someone tell me how to change it so that it copies values only to the new workbook as I'm only saving it for records purposes and some cells are saved with #REF errors.

I'm guessing there's a spot where I should type .Value ? Copy.Value doesn't work.

View 9 Replies View Related

Merge Selected Rows From Multiple Sheets Into One Sheet

Jul 14, 2009

I have around 150 excel files with sample data as follows in "sheet 1" of each workbook,

Excel doc 1:

ABC1
Column 1Column 221Data 1Data 132Data 2

Excel doc 2:

ABC1

Column 1Column 223Data 3Data 334Data 4

I want the rows with data in column 'B' and empty column 'C' from every sheet to be copied into 1 sheet.

Output to be as,

Final Excel doc:

ABC1

Column 1Column 222Data 2
34Data 4

I have a VBA code sample to select the required files in a folder and run the macro over it. The VBA is as follows,

Sub Importxlsrows()
'Import all selected rows to one sheet
Dim xlsDoc As Object
Dim xlsFileName As Variant
Dim RowNo As Integer 'row number in excel
Dim iRow As Long 'row index in Excel


'probably here we need to insert the required logic

End With
Set xlsDoc = Nothing
End If
Next i
ShowStatusFree
MsgBox "Required rows of selected files are imported into the sheet", vbInformation, "Done!"

End Sub

View 9 Replies View Related

Copy Selected File To Specified Directory

Jul 23, 2013

Basically what I want to do is to create a button which when pressed opens a file picker (I think its called this way) and the user should find and select a pdf file. And when he does that he clicks "OK" and this file is copied to specified folder.

View 7 Replies View Related

Outputting Selected Rows To New Sheets On Basis Of Values In One Column?

Oct 16, 2013

I would like to be able to output the rows in the attached spreadsheet to separate sheets on the basis of whether they have a Y or an N in the four rightmost columns - i.e. I want to make SOLO, DUO, TRIO and FULL BAND sheets.

I would ideally like these sheets to update automatically when I change the data in the main spreadsheet.

View 3 Replies View Related

Copy All Selected Sheets (data / Formats / NOT Formulas) To New Workbook

Oct 2, 2013

I had a macro on my previous laptop that worked, but didn't have the macro backed up so it was lost.

I need a vba macro that will copy all active/selected worksheets into a new workbook. Included requirements:

* Maintain tab names

* Only bring in contents/data with all formats (including logo image, but NOT formulas or hidden rows/columns)

* Keep the file name the same except adding "- FINAL" to the end

View 3 Replies View Related

VBA Create New Folder In Current Location And Save Selected Sheets As PDF

Feb 2, 2014

I have the below code that saves selected sheets of my workbook as pdfs in the current file location. What I would like this code to be able to do is to create a new folder (named with todays date), and then save each of the pdfs into this folder.

Code:
Sub SaveWorksheetsAsPDFs()
Dim sFile As String
Dim sPath As String
Dim fPath As String
Dim wks As Worksheet

[Code] ........

View 3 Replies View Related







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