- ©«¤l
- 234
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 276
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-1-7
- ³Ì«áµn¿ý
- 2021-10-7
|
¦^´_ 1# PJChen
1.¦]¬°µ{¦¡¬O°õ¦æMacro_TªºSheet,©Ò¥H®w¦sªí¤£·|Åܧó,±NActiveWorkbook§ï¬°WB
2.ªþ¥ó¤ºµ{¦¡ªºWorkboos & sheets¦WºÙ»P¹ê»Ú¤£²Å,±NMacro.xlsm§ï¬°Macro_T.xlsm,VB§ï¬°VBA
¸Õ¸Õ¬Ý¬O§_²Å¦X»Ý¨D
Sub ¸s²Õ³]©wª©±()
Dim Wb As Workbook, xActSheet As Worksheet, j As String, xi As String, x As Double, i As Long
Dim k1 As String, k2 As String, k3 As String, k4 As String, k5 As String, k6 As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False '¦bµ{§Ç°õ¦æ¹Lµ{¤¤¨Ï¥X²{ªºÄµ§i®Ø¤£Åã¥Ü
Application.Calculation = xlManual '¤â°Êpºâ
Set Wb = Workbooks(Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P1").Value) 'Àx¦s®æªºÈ¬°ÀɮצWºÙ
j = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P2").Value
k1 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P3").Value
k2 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P4").Value
k3 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P5").Value
k4 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P6").Value
k5 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P7").Value
k6 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P8").Value
x1 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P9").Value
x2 = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P10").Value
x = Workbooks("Macro_T.xlsm").Worksheets("VBA").Range("P11").Value
For i = 2 To Wb.Sheets.Count '¦b¤u§@ªí¤¤´`Àô
Wb.Sheets(i).Activate
With Wb.ActiveSheet.PageSetup
.PrintArea = j
.TopMargin = Application.InchesToPoints(k1) '¤WÃä¬É
.BottomMargin = Application.InchesToPoints(k2) '¤UÃä¬É
.LeftMargin = Application.InchesToPoints(k3) '¥ªÃä¬É
.RightMargin = Application.InchesToPoints(k4) '¥kÃä¬É
.HeaderMargin = Application.InchesToPoints(k5) '¶º
.FooterMargin = Application.InchesToPoints(k6) '¶§À
.Zoom = x '¦C¦LÁY©ñ
.Orientation = xlLandscape '¾î¦V¦C¦L
End With
Next
' End With
Application.ScreenUpdating = True '¥´¶}«Ì¹õ§ó·s
Application.Calculation = xlAutomatic '¦Û°Êpºâ
End Sub |
|