Copy Page Setup From One Workbook To Another?
May 18, 2009
Is there a way to copy page setup settings from one workbook to another in VBA?
Example, I have a spreadsheet with 5 tabs with each of them different page setup options.
I have a second spreadsheet with 5 tabs where I need to make the page setup the same for each tab as the saved spreadsheet #1.
Background: This is a workaround for not being able to do copy/paste special values for pivot tables. My workaround is to save an .xlsx as a .mht then reopen and save as .xlsx. The only problem is that I lose page setups through the process.
View 4 Replies
ADVERTISEMENT
May 18, 2009
Is there a way to copy page setup settings from one workbook to another in VBA?
Example, I have a spreadsheet with 5 tabs with each of them different page setup options.
I have a second spreadsheet with 5 tabs where I need to make the page setup the same for each tab as the saved spreadsheet #1.
Background: This is a workaround for not being able to do copy/paste special values for pivot tables. My workaround is to save an .xlsx as a .mht then reopen and save as .xlsx.
View 2 Replies
View Related
Apr 8, 2008
I generate several reports, all saved as seperate files, with the same page settings (margins, headers, footers, etc.). Is there any way to copy these page settings from one file to another so that I don't have to enter the settings seperately for each file?
View 13 Replies
View Related
Jul 22, 2006
can anyone show me the way to run a macro when visual basic editor opens
View 5 Replies
View Related
Mar 7, 2006
I am trying to change the page set up setiings to fit to 1 page for 56 worksheets within a workbook.
View 7 Replies
View Related
Jun 16, 2009
This might seem a strange type of Excel question.
Some "Clever" person decided to create a site plan using MS Excel. It has been done quite well tbh. The problem with Excel is that I am unable to set a custom page size as this plan sits nicely on a paper size I made ealier through using Word. Guess what there is a custom page size selection on Word but not Excel. Is there a walkaround for this ?
The only other way I can do this, is to print off 2 a4 landcape print out but the printer goes to the next page and leaves a nasty seperation.
The copy of Excel i have is 2003 sp3
View 9 Replies
View Related
Jun 16, 2008
I set up a spreadsheet for use by my colleagues, on an Acer 17 inch portable. My colleagues all use HP or Dell with 15 inch monitors (and different graphics cards to mine). They all complained that when they opened my sheet, the page breaks were all in the wrong place. When they fixed the breaks on their machines and I opened those file, the breaks were now in the wrong place on mine, but were all right on theirs.
I have now "upgraded" to a Toshiba 17 inch laptop, and find that my original spreadsheet done on the Acer 17 inch shows page breaks in the wrong place on my new machine.
Is this something to do with display adaptors? If so, does anyone know what I can do to standardise this across the board? (My boss uses a 20 inch screen, and the sheet for him is even more wildly out).
View 9 Replies
View Related
Jun 23, 2008
This part of my macro can be improved as it runs through over 100 sheets and takes a while?
Sheets.Select
For Each sh In Worksheets
With sh.PageSetup
.Zoom = False
.LeftFooter = "&F" & Chr(10) & "&A"
.CenterFooter = "&P of &N"
.RightFooter = "&D"
.FitToPagesWide = 1
.FitToPagesTall = 1
.LeftMargin = Application.InchesToPoints(0.15748031496063)
.RightMargin = Application.InchesToPoints(0.15748031496063)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.354330708661417)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.196850393700787)
.TopMargin = 1
.BottomMargin = 1
.Orientation = xlPortrait
End With
Next sh
View 9 Replies
View Related
Jan 8, 2009
I visited all of the sites listed in the various posts & downloaded the XLM function help file.
My question is which syntax would I use? I'm wanting to add this to an existing macro (one that currently takes FOREVER). I think syntax 1 for worksheets & macro sheets, but I'm adding to visual basic, so maybe syntax 3 for vb modules?
Here's my existing code, if anyone wants to help me change this to XLM4pageSetUp ..
View 9 Replies
View Related
Jun 13, 2007
Is it possible to protect against users changing the page setup?
View 2 Replies
View Related
Mar 7, 2008
I've managed to clean up my code removing all of the selecting to get the macro to run faster but it seems to slow down when it gets to the page setup. Is it because of the ActiveSheet? Is there a better way to code the following?
View 10 Replies
View Related
Feb 21, 2009
Once a week I need to export data to excel for a report. Some weeks there may be 30 rows and other weeks there may be 100 rows. I created a macro in the attached spreadsheet called 247 formattedV2 that seems to work fine except that it seems to get caught up in the Page Set up area. Here is the things that I have already in the macro that need to be accomplished.
1.All cells should be set to wrap text
2.Bottom justify text on row 1 for wrap text
3.Top justify all rows below it for wrap text
4.Adjust width of columns to exactly what is shown. If text runs over, it should wrap (shown in parenthesis)
5.Center all titles at the top of each column - show with grey background as indicated
6.Center text in columns A, B & C
7.Lighten grey cell in beteen each call (keep them in for all notes, they were accidently removed in this version)
8.Darken grey cell for column headers
Page setup: Set margins to narrow setting at .25 top, bottom, left, right. Set to landscape. Should be 1 page width, as many as necessary for height
Set for 8.5x14 paper (legal size)
Column Widths
•A - Last Call Date (w=10),
•B - Priority (w=7),.............
View 4 Replies
View Related
Jan 27, 2010
I have an 6 sheet excel workbook that generates 27 additional sheets upon an executed macro. I am trying to page setup the additonal 27 sheets only to a zoom of 90. Here is what I have so far but this zooms all 33 sheets.
HTML Sub zoom_2()
Application.ScreenUpdating = False
Dim wk As Worksheet
For Each wk In ThisWorkbook.Worksheets
wk.Activate
With ActiveSheet.PageSetup
.zoom = 90 End With
Range("A1").Select
Next wk
Sheets("data").Activate
End Sub
View 2 Replies
View Related
Apr 2, 2005
I am testing some code to have my sheets print consistently on different computers. I have
With ActiveSheet.PageSetup
.CenterHorizontally = True
.Orientation = xlPortrait
.FitToPagesWide = 1
End With
ActiveSheet.PrintPreview
but it still previews at more than 1 page wide. Any suggestions?
View 9 Replies
View Related
Nov 19, 2003
I was curious if in VBA is there a way to switch in the page setup from Fit to X Page by X Page to the Scaling %.
I have set all my pages to fit 1 x 1 and would now like to know the scaling % (Zoom) of the sheets.
View 9 Replies
View Related
Dec 25, 2013
I am looking to create an invoice details in excel where it correlates to the payment schedule. and the schedule is biweekly starting jan 3rd
I want to also match the start dates to each invoice date, where the invoice date is every 7 days (on a weekly basis)
But, I'm looking to have the invoice date driven in accordance to the employees start date
I'm doing this for a friend, but i'm not sure exactly what he is looking for, and what I have to do in excel
Does he just want me to keep on filling out employee 5 to finish the process?
Or should I create a separate column for each employee for it to be more detailed?
The Overall goal is to get an accurate cashflow
Attached can see what excel sheet looks like : excel.jpg‎
View 1 Replies
View Related
Sep 3, 2012
I have a vba to do page set-up:
*Left, Top, Right, Bootom as 0.5
*Header and Footer as 0.2
Once vba is run page set-up is ok ie margins but when printed Left and right margins are not 0.5cm.
solve this mystery?
Code:
Sub Print_Format()
Dim myRange As String
myRange = Selection.Address
ActiveSheet.PageSetup.PrintArea = myRange
With ActiveSheet.PageSetup
[Code]...
View 2 Replies
View Related
Jan 25, 2013
I have data range which have three sections identical in shape and size.
How should i set the page setup so that each section print on a separate page.
View 1 Replies
View Related
Apr 2, 2014
My macro "prints" (saves) my sheet as Pdf-file.
I wish to improve this such as print/save is based on the active area I choose at the time.
Now I must hide a lot of columns (show only the ones I will print) before "printing":
Columns("A:Z").Select
ActiveSheet.PageSetup.PrintArea = "$A:$Z"
I just want to select some columns and set this range as a print.setup area.
View 2 Replies
View Related
Dec 28, 2011
I've been trying to code a macro that will select a worksheet (that has formulas) to copy just the values into a new workbook. I want the page setup data to also be included. It seems that if a select the workbook and do a copy, it includes the formulas. If I select the cells, then do a paste/special values into the new workbook, the page setup is the default one. Each worksheet that I want to copy/paste has different page setup values and I'd like to be able to carry over the page setup. Otherwise, I have to have code to do all the page setup in the macro. There are over 20 worksheets and it's slow.
This code does the copy/paste special but no worksheet page setup is included
Worksheets("Data1").Range("A1:E22").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWorkbook.SaveAs Filename:= _
"U:My DocumentsLearning VBA filesTestNewWorkbook.xls"
Windows("ProjectFilesChapter07 test.xls").Activate
View 3 Replies
View Related
Jul 14, 2009
I need another big macro to search a different workbook "database" for a match. An example of what the "drawing number" will look like that the macro will search for is;
View 5 Replies
View Related
Mar 21, 2014
I am trying to add a vertical line dynamically to a chart. What I mean is I have a chart that will have a line type chart on it and I want to add a vertical line to it based on the output of one cell in that same workbook. I am making this workbook for use by end-users so I can't ask the end-users to make a bunch of modifications to the sheet or or chart. What I do has to just work when they use the workbook.
The line chart has an X axis of time and a Y axis of items sorted. (This is the part of the chart I have done already.) I want to add a vertical line fed from a cell which will have a time fed from a cell on the workbook. For example the line chart goes from 9:00 to 16:00 and the vertical line might be at 13:00. The cell feeding the vertical line is subject to change based on the other inputs on the workbook so that's why I say the vertical line has to be dynamic as the vertical line could be anywhere between 9:00 to 16:00 or it might even be that I can't place the vertical line because the feeding cell is outside the range of 9:00 to 16:00.
I have seen a number of ways to do this but none that are dynamic and automatic and don't require end user to adjust the workbook to make the vertical line at the correct on the time scale.
View 2 Replies
View Related
Dec 26, 2013
What I want to do, is to populate the Lois, Beth, Kelly and Shelley pages with the rows from the Que page when they get assigned to one of them. I tried to program then off of a different example in the forum. It didn't work. Will include the copy.
Tracking(HELP).xlsx
View 6 Replies
View Related
Oct 1, 2013
So here is my code
Code:
Sub Worksheet_SelectionChange(ByVal Target As Range) 'single click version
Range("J3:J32").Interior.Color = RGB(200, 160, 35)
Range("K3:K3").Interior.Color = RGB(200, 160, 35)
If Intersect(Target, Range("J3")) Or Intersect(Target, Range("J4")) Is Nothing Then Exit Sub
ActiveCell.Copy
End Sub
The If statement line gives me a 91 error. Simply right now i'm trying to allocate several squares in the sheet to be cells that when clicked will copy to your clipboard automatically. I can do 1 range easy but now i need to make it a little more advanced.
View 3 Replies
View Related
Nov 14, 2013
In my header I am trying to show the current page number and the total number of pages in the workbook. So if I have 10 pages in my workbook, page 5 would read "5 of 10".
I have this in my header "&[Page] of &[Pages]". All worksheets with 1 page read "1 of 1" and worksheets with 2 pages read "1 of 2" on the first page and "2 of 2" on the second page.
View 6 Replies
View Related
May 27, 2008
I have a "Menu" workbook that has 1 sheet named "MyMenu" which only has macros and Hyperlinks on it.
I would like to add a second sheet to this workbook named "SetUp".
Next, as an example, I would have the user list 20 Excel Workbook.xls files on the 2nd sheet (SetUp sheet) in Cells A1 thru A20 (as my example). In column B, directly adjacent to each file, they would enter a generic name of their choice, representing each file. These are files that they would be using frequently. The file names would be entered in cells B1 thru B20.
Now, I need 20 macros on "MyMenu" that can open these appropriate files listed on the SetUp sheet. As an example, I could have 20 macros that are located in Column D on "MyMenu". They could be located in cells D5 thru D24.
2 Things I want these macros to do . . .
First . . .
The Generic name would be displayed in the appropriate cell in column D so that the user would know which workbook they are going to open.
And Second . . .
Clicking on the Generic name would open the associated file.
NOTE: If the user were to enter a new file name in one of the cells in column A and a new Generic name, the name for the macro on "MyMenu" would automatically be changed and the new file name would be opened when the macro was clicked.
RE-STATED:
What I am looking for is a way of running macros from "MyMenu" sheet by clicking on any paticular macro I want to run just like normal . . . but, I want the macro on "MyMenu" to open the file that is listed in column A of the SetUp sheet.
REASON:
"MyMenu" has to be a locked sheet. Therefore, the user can not enter or change macros on "MyMenu". I actually have 5 or 6 macros that I would like them to be able to change, but again, "MyMenu" has to be "Password" protected. Additionally, many of the users simply don't know anything about macros or hyperlinks
View 14 Replies
View Related
Jun 9, 2009
When I view a sheet under Page Break Preview, it shows the Page numbers in the centre of the Page. While I am aware that it would not print the page number I was wondering if there is an option to remove/hide the page numbers.
View 3 Replies
View Related
May 22, 2008
I have been working with a few people on here to setup a macro to copy text from a column of cells to another column and then print this in to a text document but it seams to have got stuck in a loop ....
View 9 Replies
View Related
Dec 30, 2008
I am trying to do a macro and I want to add in a worksheet. I use the code
"Sheets ("Template") .Add"
but I keep getting an debug error. I did this in another macro but cannot find it. I need to add a specific name at the start of adding in a sheet as the sheet number increments change based on how many times you have run the macro. I know this is a silly format issue but I could not find anything in my book or searching this forum.
View 3 Replies
View Related
Jan 31, 2013
I am working on creating a summary page for my workbook. I want the code to create a destination sheet called Summary, then look at each sheet in the workbook, check for a value >0 in cell N7, if it is >0, the copy the tab name and the value in N7 and paste it into the destination sheet starting in cell A1(text of source tab name) and B1(dollar amount). Then move to the next sheet in the workbook and copy paste if N7 is >0 sheet name and value. It needs to skip the sheet XMOE. The Summary sheet would then create a dollar amount subtotal of the values copied from the sheets and populate it into Cell D1. Cell C1 would state "Workbook Subtotal"
I would like the code to delete any sheet where N7 = 0.
View 2 Replies
View Related