Macro adjustments
-
Just have a quick question regarding the macro below. It is working perfectly however the only question/issue im having is that it is not zooming in the data and fitting it onto one page. Right now it is fitting all the data into one page which I really need it do, however the data once fitted to one page is very difficult to read. So if you can assist me, with this problem. Thanks in Advanced P.S Macro is Below Vish --X-- Sub ShowPrintParameters() ' Keyboard Shortcut: Ctrl+t ' ' Dim sh1 As Worksheet, bk As Workbook, r As Range Dim sh As Worksheet, sPath As String, s As Variant Dim sName As String, rw As Long, rw2 As Long, sh2 As Worksheet Dim l As Long Set sh1 = ActiveSheet ' add a sheet as the end to record the changes made Application.ScreenUpdating = False Worksheets.Add after:=Worksheets(Worksheets.Count) Set sh2 = Worksheets(Worksheets.Count) sh1.Activate Application.ScreenUpdating = True sh2.Range("A1:G1") = Array("Workbook", "Worksheet", "Changed from", "Changed to", _ "Height", "Width", "Constant") sh2.Range("A1:G1").Font.Bold = True rw2 = 2 With Application.FileDialog(msoFileDialogFolderPicker) InitialFileName = "C:Documents and Settings ishantmDesktop ob\" Title = "Please selected the folder containing the files you would like to consolidate." Show If .SelectedItems.Count = 0 Then Exit Sub Else sPath = .SelectedItems(1) & "\" End If End With sName = Dir(sPath & "*.xls") rw = 2 Do While sName <> "" Set bk = Workbooks.Open(sPath & sName) sh2.Cells(rw2, 1) = bk.Name For Each sh In bk.Worksheets sh.Activate sh2.Cells(rw2, 2) = sh.Name l = sh.PageSetup.Orientation If l = 1 Then sh2.Cells(rw2, 3) = "Portrait" Else sh2.Cells(rw2, 3) = "Landscape" End If Set r = sh.UsedRange If r.Width > 0.5 * r.Height Then s = xlLandscape sh2.Cells(rw2, 4) = "Landscape" Else s = xlPortrait sh2.Cells(rw2, 4) = "Portrait" End If sh.PageSetup.Orientation = s sh.PageSetup.CenterHorizontally = True sh.PageSetup.CenterVertically = True sh2.Cells(rw2, 6) = r.Width sh2.Cells(rw2, 5) = r.Height sh2.Cells(rw2, 7) = s With sh.PageSetup .LeftMargin = Application.InchesToPoints(0) .RightMargin = Application.InchesToPoints(0) .TopMargin = Application.InchesToPoints(0) .BottomMargin = Application.InchesToPoints(0) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = True .PrintGridlines = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With rw = rw + 1 rw2 = rw2 + 1 Next sh 'save the changes done to center the worksheet horizontally and vertically for printing bk.Close SaveChanges:=True sName = Dir() Loop End Sub
-
Answer:
Not sure what you are asking. IF you want to fit the "printout" to just one page AND you have a lot of data to fit on the "printout" then you have no other choice than for the text to be small. The amnout of data you are trying to fit on the "printout" will dictate how small the print will be.
Miningco.com Visit the source
Related Q & A:
- What is micro and macro?Best solution by Yahoo! Answers
- What is the difference between Economics MICRO and MACRO?Best solution by Yahoo! Answers
- Will a 215/35/18 tires with rims work on a Toyota Camry 1996 LE v6 without any problems or adjustments?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.