Macro For Multiple Print Options

Apr 23, 2014

I am looking to design a Userform with "OptionButtons" in which the user selects 1 of 4 print formats. I was going to have one single button that stimulates the userform mentioned which allows the user to pick from 4 options. Then there will be a commandbutton1 on userform which allows them to "Print Preview" the selected print style and a commandbutton2 on the userform which allows them to "Print" with the chosen style. The following are the 4 Print Formats:

Print1:

.2 Margins (Top/Bottom/Sides)
Fit all Columns To Page
Rows 1-17 are Normal

From row18 on every row with text in columnA becomes a print break with row16 as a header before it. (the point of this is that row16 is a header but since it will always on the first page and row17 is a text row that would kick it on the next page)

Print2:

.2 Margins (Top/Bottom/Sides)
Fit all Columns To Page
Cells A1:F15 select fit to page and center (This will be the 1st page)
Row16 becomes header for the rest of the sheets. Then each row with text in columnA becomes a print break

Print3:

.2 Margins (Top/Bottom/Sides)
Fit all Columns To Page
Cells A1:F15 select fit to page and center (This will be the 1st page)
Row16 becomes header for the rest of the sheets. Then each row with text in columnA becomes a print break. Hide ColumnE and ColumnF after row15.

Print4:

.2 Margins (Top/Bottom/Sides)
Fit all Columns To Page
Cells A1:F15 select fit to page and center (This will be the 1st page)
Row16 becomes header for the rest of the sheets. Then each row with text in columnA becomes a print break. Hide Column A, B, E, F after row15.

View 1 Replies


ADVERTISEMENT

View / Print Selected Options Contiguously Separate Page

Oct 24, 2008

I’ve created a worksheet containing many drop down lists that form an inventory of household effects. Once selected, I’d like to be able to view/print the selected options and quantities separately on one A4 page.

I don’t want the separately viewed/ printed page to contain anything other than the selected options. The problem I’m having is to arrange this new page as a contiguous list.

View 2 Replies View Related

Create A Default Template That Will Apply All The Same Formatting, Print Options

Nov 5, 2004

Is there any way to create a default template that will apply all the same formatting, print options, etc to every new workbook that I create. I guess what I am asking is a way to change the excel defaults for text type, border size/color, etc.

View 4 Replies View Related

Multiple Options Cell Values Based On Multiple Criteria Variable Inputs?

Mar 18, 2013

I maintain the data flow at my work. We send and receive the data using excel files with specific formatting that I then upload to the database. Each time I send or receive the excel file I must log them, this is what my code question refers to.

I use RDBMerge to merge all the contents of the 100 plus excel files into one worksheet. The first part of the macro cleans up the merge data for use in the log (i have attached an example of the clean data and finished log).

The blue shaded area of the "Raw_Data" is what the clean data looks like, the yellow column is what current macro records for each record.

As you can see by the example the Raw_Data is only two files LL_LLL_BOB_ToLLLLL_20121228_01 & LL_LLL_BOB_ToLLLLL_20121230_01, each with more that one record.

The log code in column "H" Is based on this criteria:
First Letter of the Unique ID in column "E" - O, M, or L
Program Type in Column "F" - U or R
1. O-U = U
2. O-R = RU
3. M-U = U2
4. M-R = R2U
5. L-R = R

You will note that Columns G-R of the "Log Sheet" correspond to the "Record Type" found in Column "G" of the "Raw_Data" sheet.

This is the area where my skill at using scripting dictionaries fails.

The results for the log list each file only once, but the log code for each corresponding "Record Type" in columns G-R of the "Log Sheet" must contain each unique instance of the code. In other words

if LL_LLL_BOB_ToLLLLL_20121228_01 contains an O-U with an "A" Record Type and an M-R with an "A" Record Type; then, on the log sheet there needs to be the codes "U/R2U" in the cell intersection of the LL_LLL_BOB_ToLLLLL_20121228_01 record row and "A" column (which is column "G")

So, If the File contains one of each code for each Record Type the corresponding cell must house one of each code separated by a "/" without any spaces. This means the cell value could no code, or one code and all the variations in between to all five codes. Also, for ease of human reading the log codes should be concatenated in the 1-5 order that I listed them in (U/RU/U2/R2U/R)

Here is my code so far.

VB:
Option Explicit
Sub test()
Dim dic As Object, a, i As Long, rng As Range, e, w, n As Long
Set dic = CreateObject("Scripting.Dictionary")

[Code].....

View 1 Replies View Related

Macro: Print Ranges From Multiple Sheets

Dec 6, 2006

I am trying to write what I thought would be a simple macro to print out specific areas of my worksheets. I have shown the code below; the line causing the problem I have highlighted in RED. I am getting the following error message: "Select method of range class failed".

Reading other posts here. I think this may have something to do with the macro being assigned to a command button in one worksheet (AY114) and I am trying to get the macro to run on both the worksheet that the command button is in (AY114) as well as another worksheet (AY062).

Sub CommandButton1_Click()
Range("J2").Select
Sheets("AY114").Select
Range("A4:J53").Select
ActiveSheet.PageSetup.PrintArea = "$A$4:$J$53"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.SmallScroll Down:=45
Range("A56:M151").Select
ActiveSheet.PageSetup.PrintArea = "$A$56:$M$151"......................

View 4 Replies View Related

Macro To Print A Variable Number Of Multiple Sheets

Aug 25, 2010

I am trying to build a macro to work with a template file.

The template file has set sheet numbers and names (with one exception, see 4) below).

There are close to 40 sheets in all.
Some sheets are never printed.
Some sheets are always printed.
Many sheets are printed only if they are used.
Most of the sheets are 'break out' sheets and a variable number of them will be used.

So... Here is what I'm trying to accomplish.

1) Always print Sheet4(Overview1)
2) Always print Sheet6(Overview2)
3) Print Sheets 11 thru 40 IF value in cell G50 on these sheets is > 0. Note that this cell has a name (Total) and I would like to reference the name if possible. (It could happen that further evolution of the Workbook moves the cell up or down a row.)
4) Print Sheet38(Data Sort) IF it exists. Otherwise, print Sheet1(Data).
If the information on the Data sheet is limited (eg only 1 or 2 pages), we print it off directly. If the information is more extensive, we copy it to a new sheet and sort it (Data Sort).

I can achieve 1) and 2). I'm not quite sure how to go about 3) as I'm still not very good with macro loops. 4) I haven't tackled yet.

View 3 Replies View Related

Macro To Print Multiple Named Ranges To Single PDF?

Apr 29, 2013

What I have is a large number of sheets in a workbook (26 to be exact). Each of these sheets has one specific named range. The file itself is quite large so I would like to print these ranges to a single PDF file. I did my best to search for this topic in the forums and while I did find some macros that were close, there was some sort of piece of code missing. Also, will how I list the named ranges determine the order of how they will show up in the PDF File?

View 3 Replies View Related

Print Macro For Multiple Ranges And Graphs On One Worksheet To Separate Pages

Mar 26, 2014

There were 2 macros. One printed all of the defined ranges (40) on separate pages, and the other printed all the graphs ("charts" - 39) on separate pages. I tried to combine the VBA code to print each range and then the corresponding graph. Everything is still on separate pages, but it saved time because I didn't have to collate after printing. It seemed to work. Then I tried figure out if I could print them all to a specific tray of the printer as set in the workbook or as the printer default. Now both the combined macro and the original macro are giving errors.

Is the code I have correct to do what I am trying to do (print each range and then the graph all on separate pages)? Is there any way to put the output tray choice into the macro?

Sub Load_Data_Report()
'
' Load_Data_Report Macro (print all tables & graphs)
' Macro recorded 12/21/00 by xxx
'
' Keyboard Shortcut: Ctrl+j
'

[Code] ........

View 1 Replies View Related

Counting Multiple Options

Dec 6, 2009

Having great success at using Countif and Sumif in totaling values across two sheets, but at the risk of sounding like a dummy I would like a suggestion as to which formula I should be using for this basic little function;

I have a column on a sheet with dropdowns offering 4 options; Active, Cancelled, Completed, and Suspended. I'm using Countif to total the number of "Active" but I also need to total the number of "Canceled", "Completed", and "Suspended" under the one heading, as if they all meant the same thing.

View 6 Replies View Related

Select Case Multiple Options

Apr 5, 2007

I have a Case Select statement I just learned how to use yesterday (kind of) What I am wondering is can I have multiple arguements or conditions to each case? For example: my sheet is a "Job Cost Estimate" for construction sales people. The section I am working on is "Fasteners"

I have 2 drop down boxes per line. The first box selects the fastener type, (Screw, Nail, Auger) the next box selects the size in inches and half inches (16 different sizes). Currently the select statement is set up for screws and says if this size then this price. I want to say if this type of fastener and this size then this price.

Additionally, when I select a size in my drop down box, I have to click somewhere else to get it to calculate. Is there a way to select the option and it auto calculates?

Here is my statement in my Worksheet selection change section:

Select Case Range("AZ21").Value ....

View 9 Replies View Related

Multiple Bonus Options On Sales Tracker

Aug 1, 2013

I am a bit of a novice with excel. I have created my own sales tracker where I get two forms of bonus.

Sheet 1 I have with all my sales. Based on the amount of sales I do I get a set bonus for each amount.
Sheet 2 I have for all the sales that progress.

They also are on a value basis- for every sale I get a certain amount of bonus. I have 2 cells calculating the amount of points. I was wondering if there was a way to have the cells calculate from the bonus table what i would get without me adding it up manually.

Sheet1 is booked leads.H3 calculates the total amount of points.
Sheet 2 is the paid occurences. F2 of that sheet is total points.
Sheet 3 is the bonus structure.

I am looking to put all the information in sheet 1:

Booked Bonus
Occurred Bonus
Total Bonus

Bonus structure is as follows:

Booked Payout Table
Occurred Payout Table
Net Points
Total Bonus

Net Points
Total Bonus
16
GBP 250

[Code] .....

View 4 Replies View Related

VBA Code To Select Multiple Options From Dropdown

May 14, 2012

correct below code?

Code:
Private Sub WorkSheet_Change(ByVal target As Range)
Dim rngdv As Range
Dim oldval As String
Dim newval As String
If target.Count > 1 Then GoTo exithandler
On Error Resume Next
Set rngdv = Cells.spcialcells(xlCellTypeAllValidation)

[code].....

i would like to select multiple options from dropdown... but it is not working...

View 4 Replies View Related

Find Multiple Files With Options To Open?

Feb 13, 2013

I have a macro to find me a document from a certain details, but in some circumstances their may be multiple applicable documents, I know nothing of user forms, but how to I find all the documents, show their "modified date", "Name","File type" and select one or which several to open.

My current code:

Code:

Code:
Private Sub OpenPDF()
Dim Ans
Dim TheFile As String

[Code]....

To have something more like a form popup showing for a search within a folder for files containing 'Brians Store':

Open? Name Date
O "Quote Brians Store - ProductsA.xlsm" 1/2/12
O "Quote Brians Store - ProductsB.xlsm" 1/1/12
O "Quote Brians Store - ProductsA.xlsm" 1/5/11
O "Quote Brians Store - ProductsC.xlsm" 1/4/11

And I may want to open the 1st, 2nd and last files.

View 4 Replies View Related

Updating Multiple Chart Options (e.g. Title)

Apr 2, 2007

Is it possible to update Chart Titles in Batches. For the following Titles:

'Client 1, Jan 07'
'Client 2, Jan 07'
'Client 3, Jan 07'
'Client 4, Jan 07',

Would you be able to change 'Jan 07' to Jan 08' on all of the above whilst keeping the variable client name, in a single batch process?

View 3 Replies View Related

Print Multiple Pages With Single Print Job

Feb 14, 2007

I have a spreadsheet with 28 visible tabs. When I select all tabs and print, I get 3 cover (or banner) pages...I like having the first banner page, but the other two are in the middle of my report. I assume excel is sending 3 print jobs and I'm not sure why.

I've seen a couple of posts regarding this issue when using VBA, but I'm not using VBA...just selecting all the sheets and sending a single print job, but get 3 banner pages.

View 9 Replies View Related

Macro To Print Sheets With Value In Cell A1 But Print Dynamic Ranges On Certain Sheet

Sep 24, 2013

I've found some code which works to print certain pages with value in cell A1 but I need to print dynamic ranges on some of the sheets as they will have filters on so the rows ranges will be different each time.

So far this is what I have but the dynamic range part is not working:

VB:
Sub Print_All_Worksheets_With_Value_In_A1()
Dim Sh As Worksheet
Dim Arr() As String
Dim N As Integer

[Code] ....

View 3 Replies View Related

Deleting Rows Based On Multiple Filter Options?

Aug 3, 2012

I need to review a 400,000 row spreadsheet and remove all records where 5 columns are populated with data so I am only eft with records that are missing information.

View 9 Replies View Related

Formula To Have One Cell Display Multiple Options Depending On Value In Another Box

Oct 1, 2013

I need to build a formula to have one cell display multiple options depending on a value in another box.

If Value is >x and <x display Y

Details:

Cell D5 Holds a dollar amount. E5 is where the calculation will happen. Logically i need it to do the following exactly:

If D5 is between 5000 and 9999, display 75. If D5 is between 10000 and 14999 display 150. If D5 is between 15000 and 19999 display 200. If D5 is >20000 display 250.

View 2 Replies View Related

Table Lookup Based On Multiple Data Validation Options?

Apr 23, 2013

i am attaching a sheet here.

i have put data validation list in three columns

from data lsts i select unit type , then hinge type then code.... the problem is that as soon as i select code all the values (H W D ) in the next three cells should automatically change.

the values against each cabinet code are also provided in the same sheet.

Sr No.
Unit Type
Unit Type
Code
H
W
D
Qty

1
Base Unit
Double Hinged Door
B60
720
600
580
2

2
Base Unit
Single Hinged Door
B30R
720
300
580
4

View 2 Replies View Related

Stop Print Macro Firing Before Print Event

Oct 18, 2006

I have a "submit" button macro which user would click after he has finished his input. This macro would update a reference number on the worksheet named "orange" and then print out this worksheet.

My purpose is "orange" is printed out with a reference number.

Below is the 1st code.....

View 9 Replies View Related

Print Multiple Worksheets As 1 Print Job

Jun 2, 2008

I'm using VBA code to select several worksheets at once, and print them. The code runs fine, but the result is multiple print jobs, not one job. This is OK when printing to the printer...but undesireable if you want to print to a pdf file, for example.

I've searched the site and found some references to this possibly being an excel problem. Is that true?

I've also checked the page setup setting to make sure that the print resolutions are all the same...that doesn't appear to be the problem either.

View 6 Replies View Related

Force Macro To Remove Cut, Copy And Paste Options

Feb 18, 2010

I have been using excel for years but have always managed to resolve issues using formula's etc but now i have had to step into the realms of macro's. I am slowly learning but urgently need help with the below problem which is bound to be a simple solution.

I have compiled a workbook for users to administrate on a daily basis. (each worksheet is a different day of the month but the same template) There are a few hidden worksheets as the info is extracted from these to run reports.

The issue/s i have is that administrators use cut, copy and paste to repeat data opposed to retyping, this messes formats, formulas and validation up. I have used a macro from the net to remove this option and it works fine. Problem is that if they do not enable macro's this will cease to be an option.

I understand that you cannot remove the option of enabling macro's but you can force. Again used a macro from the web that if you don't enable it only shows a welcome page saying that macro's need to be enabled to use. (all others are hidden) if macro's are enabled the welcome page disappears and the worksheets 1-31 reappear. Again this worked fine.

I tried putting both macro's into the same workbook but kept coming up with errors, each one i resolved led to another.

So short of it i need a instructions/macro to force macros and remove cut copy and paste.

View 14 Replies View Related

Can't Assign Shortcut To Macro: 'Options...' Button Disabled

Feb 23, 2010

I'm trying to assign a shortcut to a macro I wrote in VB. However, when I go to Tools->Macros->Macros, none of my macros (whether coded in VB or recorded) have the "Options..." button enabled, so I can't assign the macro. This happens whether I use Excel 2003 or Excel 2007. The file is not readonly and I have tried the various levels of macro security. I have VBA installed.

View 5 Replies View Related

Option To Print - Use Print Macro

Dec 30, 2008

I have a few macros that run in a sheet. After the macros are finnished I would like to present to the user a msgbox that asks if they would like to print. if "Yes" is selected, the print macro runs. If "No" is pressed then nothing happens.

View 3 Replies View Related

Disable Print But Allow Print From Macro

Jun 11, 2007

I have found a macro which disables all print features in excel. I have rwo other codes to print. When I put this macro, It also disables the print from the other macro. How can I use this code so that normal print features will be disabled but if someone takes the print from the macros, Print will be allowed. The code which disables the print is given below:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If PrtOK Then
Cancel = False
Else
MsgBox "Can't print from here!"
Cancel = True
End If
End Sub

View 9 Replies View Related

Programmable Print Area: Macro To Set The Print Area According To The Amount Of Data In A Particular Range Of Cells

Feb 25, 2009

Using Excel 2003 I am trying to write a macro to set the print area according to the amount of data in a particular range of cells. I find I can include this instruction

View 2 Replies View Related

Print Multiple Ranges From Multiple Sheets Userform

Jun 16, 2007

I inherited a spreadsheet that had an userform where the user checked off which 'pages' he wanted to print. The Ok button routine used if statements to run a routine for each 'page.' Here's an example of the original code for one page:

Sub Button2_Click()
Sheet7.Activate
Run "HorizontalPrintStuff" 'generic landscape pagesetup
With ActiveSheet.PageSetup 'specific pageset settings
.RightFooter = " Construction Assumptions"
.PrintArea = "CONSTRUCTION" 'the named range to print
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1 'this changes depending upon the page selected
End With
ActiveSheet.PrintOut
End Sub

The problem was it printed each page as a separate print job; and if you print to adobe, you get serveral files, not one file. That and it took a long time to run.

So I tried a different tack. If the checkboxes has true, then the printarea is set to that named range. If there were more than one named range on a sheet to be printed, I consolidated them. I did this with a bunch of if statements - very cumbersome.

Sheet3.Activate
'Sheet3.ResetAllPageBreaks 'disabled due to errors
Run "HorizontalPrintStuff" 'generic landscape pagesetup
With ActiveSheet.PageSetup 'specific pageset settings
.PrintArea = "DEVBGTALL" 'the named range to print
.FitToPagesWide = 4 'this changes depending upon the
.FitToPagesTall = 1
End With

I haven't shown all the code cause it goes on for 12 sheets containing 16 different printareas.

My current muck ups are .....

1) it prints every printarea/named range on a given sheet (I took out all the if statements trying to debug everything.) Is there another conditional argument that allows for multiple 'trues'?

2) the pagebreaks in printarea/named ranges that are multiple pages (like a 48 month schedule) won't stay set. I've tried both VPageBreaks(3).Location:= and .VPageBreaks.Add Before:=

3) the Sheet1.select false argument is always adding a random sheet to the end of the print job. Don't know why.

I can do all this in a recorded macro, just not the selection userform. I've thought about copying to another sheet or hiding columns and rows then printing, but that seems just as cumbersome.

To recap, i want to print out, as one print job, multiple printareas from mulitple sheets, based upon checkbox selection on an userform.

View 6 Replies View Related

Conditional Formatting :: Use Of "OR" Multiple Options

Jan 5, 2009

i am using excel 2007. can you use multiple options within a conditional format without having multiple conditional formatting. i know that you can use "or" within a function string, is it possible within the conditional formatting

View 6 Replies View Related

Excel 2010 :: Macro Runs On Protected Sheet But Changes Protect Sheet Options?

Feb 24, 2011

I am using Excel 2010 and I have a password protected workbook with password protected sheets that uses several macros. Most of them, in order to run, have to un-protect the sheet and then re-protect it again. This has been accomplished easily enough by adding ActiveSheet.Unprotect Password:= "mypassword" and ActiveSheet.Protect Password:= "mypassword" to the appropriate places in the script. All of my macros, which do various things like sorting and moving data, deleting blank rows, displaying dialog boxes containing warning messages etc. run fine.

My problem is this: when I password protect the sheets manually, I have checked the following options in the "Protect Sheet" dialog box. Under "Allow users of this worksheet to" I have checked 1)Select unlocked cells and 2)Format cells. After entering my password and closing the dialog box my sheet is protected, but I can edit cells in the manner my allowances permit. However, once I run any of the macros that un-protect and re-protect the sheet, I remain able to select and edit unlocked cells (practically, for my purposes, this means that I can input data which will appear in the default font size and color of the sheet) but I cannot format cells (which, practically, for my purposes would allow me to occasionally change the font color and size of the data). Naturally, after running a macro, the other cell-formatting options are unavailable to me as well. Is there any way to get my manual selections to remain in place after running a macro that functions as mine do? Or is there any way to make my manual selections the default settings for a protected sheet?

View 4 Replies View Related

Print Multiple Tabs?

Dec 22, 2008

I have 3 sheets in the same workbook that I want to print in 1 PDF report, is there a way that I can do this?

View 2 Replies View Related







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