- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
|
¦^´_ 11# starry1314
Option Explicit
Sub ¥¨¶°1()
Dim c As Range, firstAddress$, myColumn%
With Sheets("¤u§@ªí1")
Set c = .Rows(3).Find("P.P", LookIn:=xlValues) '´M¨D²Ä¤@ӥؼЪ«¥ó
If Not c Is Nothing Then '¦pªGcª«¥ó¤£¬O¬°Nothing®É¡A°õ¦æ
firstAddress = c.Address '°O¿ý§ä¨ìªº²Ä¤@Ó¦ì¸m
myColumn = 1 '³]©wAÄæ
Do
'.Range(.Cells(2, myColumn), .Cells(Rows.Count, c.Column).End(xlUp)).Name = "Print_Area" '
.Range(.Cells(Rows.Count, myColumn).End(xlUp), Cells(2, c.Column)).Name = "Print_Area" '³]©w¦C¦L½d³ò¡A¥H³]©w½d³ò¨Ó»¡¡A¨Ò¦p¡G"A1:C5"©M"A5:C1"¬O¤@¼Ëªº·N«ä
'¥u¤£¹LAÄæ¥i¥H§ä¨ì³Ì«á¤@¦C¡A©Ò¥Hn¥Î«áªÌ¨Ó³]©w½d³ò
.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False '¦C¦L
Set c = .Rows(3).FindNext(c) '´M§ä¤U¤@ӥؼЪ«
myColumn = myColumn + 19 '¤U¤@ÓÓ¦ì¸m¬°TÄæ...¦A¨Ó¬OAMÄæ¡A¨Ì¦¹Ãþ±À
Loop While Not c Is Nothing And c.Address <> firstAddress '·ícªº¦ì§}©M²Ä¤@Ó¦ì§}¬Û¦P®É¡A¸õ¥X°j°é
End If
End With
End Sub |
|