VBA To Setup Page Margins And Printout To Match It
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
ADVERTISEMENT
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
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
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
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
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
Jul 22, 2006
can anyone show me the way to run a macro when visual basic editor opens
View 5 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
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
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
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
May 15, 2013
I'm trying to use DGET to pull coordinate pairs from a list and match them up to a label based on certain criteria. I can't seem to get it to work. I'm also thinking that the way I have it set up, the coordinate pairs might not stay together and that has to be the case. My criteria is multiple cell based too and I don't think DGET can handle that.
For example, In order for a coordinate pair to be labeled "B" the x coordinate must satisfy a condition and the y coordinate must satisfy a different condition. Can I use DGET with the AND function?
View 6 Replies
View Related
Mar 26, 2014
We use a spreadsheet for developing loans. I can open and print all of them just fine and so can almost all of the other employees. We have two people, though, that have the margins change when they open them. I can open it and have it be just fine, close it, they open the exact same file and see changed margins.
How to change that. I don't want them to have to do it on each spreadsheet. I am looking for a complete, one-time-only fix.
View 6 Replies
View Related
Dec 19, 2006
I have a list in excel.......(see attached) In the attached you will see some empty boxes for this purpose I have only provided a dummy duplicate. In the original I have information in these boxes.
Problem:
When i go to print preview the list boxes fall half way down the page instead of at the top of the page......when I try to adjust the margins in print preview, manually, or either in page setup it doesn't rectify it.
View 7 Replies
View Related
May 1, 2014
These functions are returning the wrong answer of zero in col GJ , I have put correct answers into col GO
They are looking at the dates in cols FP to FR , then averaging all margins
View 2 Replies
View Related
May 1, 2013
I have designed an excel spread sheet for my staff to fill in when completing care plans - there are a lot of drop down boxes etc., on the form - when it comes to printing 3 computers on the office print it fine but the other 3 the margins seem to move and the sheets come out totally wrong - I have checked the setting and we are all using the same setting etc., but it is still happening - we are also all printing to the same printer.
View 1 Replies
View Related
Feb 13, 2009
Sheets.PrintOut. I have a button which uses:
View 4 Replies
View Related
Jun 29, 2006
I have a workbook on a web site. That workbook has the following
sFileName = sPath & ThisWorkbook.Worksheets("Retailer Lists"). Range("A" & c).Value & "/Fact+ Sheet.xls"
Workbooks.Open Filename:=sFileName
ActiveWorkbook.PrintOut
ActiveWorkbook.Close
When I run the code, the active workbook is the "sFileName" file. There are a couple of problems that I can't seem to get around. First of all, when I run the code, I get a Method 'Open' of object 'Workbooks' failed error. If I debug, it is on the Workbooks.Open statement shown above. If I do nothing but hit F8, the file opens. The second issue is nothing prints. The file is available to me and I can access things on the sheet, but it will not print. By the way, the CLOSE command works perfectly. Is there a different way that I should be accomplishing the printing?
View 2 Replies
View Related
Oct 27, 2009
I have a worksheet that has two different years and I am trying to update a summary page that pulls the amount based on the year in the following formula.
View 5 Replies
View Related
Feb 9, 2014
I have a letter and numbers in the A column. example: (A001_C108_1231Xb)
This kind of numbers go from Column A1 : A1800.
I need to print them out, therefore I would like to fill every page which has 50 rows and 3 columns : A, D and G to write in the data.
I tried to do it manually, which is quite some work.
View 5 Replies
View Related
Apr 15, 2009
I wanted to make a macro that saved my worksheet, then printed all the different tabs. The save is, of course, easy. Printing all tabs is being more difficult.
I tried to use the macro recorder, but all it did was select range, and then name each tab.
My tab names change though, so I need something that will just select all tabs.
View 6 Replies
View Related
Aug 30, 2007
Sub print_recap()
PrintOut Copies:=1
End Sub
this returns a "sub or function not defined" on the printout line
Sub print_All_recaps()
Set ws = Worksheets("Employees")
If UCase(InputBox("Enter y to print ALL the records")) <> "Y" Then Exit Sub
For n = 2 To ws. Range("A65536").End(xlUp).Row
Cells(2, 2) = ws.Cells(n, 1)
PrintOut Copies:=1
Next
End Sub
If I remove the PrintOut line I do not get an error.
View 9 Replies
View Related