- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 3# dechiuan999
¨Ì1#ªþÀÉ ²Ä¤@Óªí®æ©Ò¼g, ¸Õ¸Õ¬Ý- Option Explicit
- Dim Sh As Worksheet, Rng As Range
- Sub «ö¶s() '«ö¯Ã«ü©wªºµ{¦¡
- Dim ¦L¦C As String
- Set Sh = ActiveSheet
- Set Rng = Sh.[A1:G20] 'ªí®æ½d³ò
- Do
- ¦L¦C = InputBox("¦L¦Cªí®æ: ½Ð¿é¤J 1 ©Î 2 ", "¦L¦Cªí®æ")
- Loop Until ¦L¦C = "1" Or ¦L¦C = "2" Or ¦L¦C = ""
- If ¦L¦C = "1" Then
- With Sh
- .PageSetup.PrintArea = Rng.Address
- .PageSetup.FitToPagesTall = 1
- .PageSetup.FitToPagesWide = 1
- .PrintOut
- End With
- ElseIf ¦L¦C = "2" Then
- ¤G±iªí®æ
- End If
- End Sub
- Private Sub ¤G±iªí®æ()
- Dim R As Range, ActionShape As String, i As Integer
- With Sh
- ActionShape = .Shapes(Application.Caller).Name '°õ¦æ¦¹µ{¦¡ªº«ö¶s¦WºÙ
- '---¦¹¦æµ{¦¡½X «öF5 ©Î F8 ·|¦³¿ù»~ »Ý¬O¦b¤u§@ªí«ö¤U [«ö¶s] °õ¦æ ----
- Application.ScreenUpdating = False
- Rng.Copy Rng.Offset(Rng.Rows.Count) '½Æ»sªí®æ
- For Each R In Rng.Rows '
- R.Offset(20).RowHeight = R.RowHeight '½Æ»sªí®æ:½Õ¾ã¦C°ª»Pªí®æ ¬Û¦P
- Next
- .PageSetup.PrintArea = .Range(Rng, Rng.Offset(Rng.Rows.Count)).Address
- '³]©w¦L¦C½d³ò
- .PageSetup.FitToPagesTall = 1
- .PageSetup.FitToPagesWide = 1
- '.PrintPreview '¦L¦C¹wÄý
- .PrintOut '¦L¦C
- For i = .Shapes.Count To 2 Step -1 '§R°£¹Ï¤ù:¤ù¥Ñ«á§R°£¨ì²Ä2Ó
- If .Shapes(i).Name <> ActionShape Then .Shapes(i).Delete
- '±Æ°£Shape¬O«ü©wµ{¦¡«ö¯ÃªºShape
- Next
- Rng.Offset(Rng.Rows.Count).Clear '²M°£: ½Æ»sªí®æ
- Rng.Offset(Rng.Rows.Count).RowHeight = .Cells(.Rows.Count).RowHeight
- '¦^´_¦C°ª
- .PageSetup.PrintArea = Rng.Address '¦^´_¦L¦C½d³ò
- Application.ScreenUpdating = True
- End With
- End Sub
½Æ»s¥N½X |
|