Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Thanks for your reply. Your assumptions about the worksheets are all correct I pasted the code into a general module, and am receiving a compile error on the sixth line - the text Icase is highlighted, with a message "Expected: Case" As a test, using Page Setup, I resized all the worksheets to 50%, expecting the code to make printed copy defined and sized per the code. It prints as 50%. Maybe correction of the compile error will make the code work Phil |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there is no Icase in the code
there is ? lcase(wsSheet.name) sheet2 Which works fine. However, in that lin of code, CASE got omitted. It should be Select Case LCase(wsSheet.Name) But there were a couple of other typos. Try this Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wsSheet As Worksheet Dim rng As Range, ar As Range Dim lngZ As Long For Each wsSheet In ActiveWindow.SelectedSheets Select Case LCase(wsSheet.Name) Case "scorecard" lngZ = 95 With wsSheet Set rng = .Range("B1:BA45") End With Case "Customer", "Financial", "Learning", "Process" lngZ = 90 With wsSheet Set rng = .Range("B1:BA32,B33:BA64,B65:BA96") End With Exit Sub Case Else With wsSheet.PageSetup .FitToPagesWide = 1 .FitToPagesTall = 1 End With Exit Sub End Select With wsSheet.PageSetup .Zoom = lngZ End With Cancel = True On Error GoTo ErrHandler Application.EnableEvents = False For Each ar In rng ar.PrintOut Next Next ErrHandler: Application.EnableEvents = True End Sub -- Regards, Tom Ogilvy "Phil Hageman" wrote in message ... Tom, Thanks for your reply. Your assumptions about the worksheets are all correct. I pasted the code into a general module, and am receiving a compile error on the sixth line - the text Icase is highlighted, with a message "Expected: Case". As a test, using Page Setup, I resized all the worksheets to 50%, expecting the code to make printed copy defined and sized per the code. It prints as 50%. Maybe correction of the compile error will make the code work. Phil |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom
I entered the code and it doesn't work. Likely, I have omitted an important point in problem description. Can I send this file to you Phil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
modification to this code | Excel Discussion (Misc queries) | |||
Code modification help | Excel Worksheet Functions | |||
Can I adjust print scaling for multiple print areas on the same sh | Excel Discussion (Misc queries) | |||
Need to print a workbook but worksheets have diff print areas | Excel Discussion (Misc queries) | |||
Modification to code | Excel Programming |