- ©«¤l
- 15
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 23
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2016-9-22
- ³Ì«áµn¿ý
- 2021-3-26
|
¦^´_ 11# GBKEE
º¥ý·PÁÂG¤jªá¨º»ò¦h®É¶¡¡AÁÙ³o»ò§Ö¦^À³¡A¶W·P°Êªº¡I
°õ¦æ«á·|¦³"Åܼƥ¼©w¸q"¿ù»~¡Aµ{¦¡Åã¥Ü¦b For i = 0 To .HPageBreaks.Count ¡A·í¤¤ªºi ¤Ï¥Õ
¤p§Ì¥Î¦Û¤w쥻ªºVBA½X¡A¤g¬¶¸Ñ¨M°ÝÃD¦p¤U¡G
¦]¯à¤O¤£¨¬±q¿é¥X¶(¨Ó·½¶)§ï½Æ»s½d³ò¡A´N´«±q¿é¤J¶(¶×¥X¶) ¤U¤â
쥻§PÂ_[A16]¦V¤U¨ì³Ì«á¤@¦C¦Aoffset¤@¦C, §ï¥Ñ±q[F16]¶}©l§PÂ_¡A¦V¤U¨ì³Ì«á¤@¦C¦Aoffset¨ìAÄæ¡A
¦]FÄæ¦b¿é¥X¶YªÅ¥Õ¡A쥻´NµL¤½¦¡(µL¸ê®Æ)¡A©Ò¥H¨ì¤F¶×¥X¶¤]¬OµL¸ê®Æ¡A¥Î¥H¤W¤èªk«K¥i¥H¦³½Æ»s¸ê®Æ³sÄò©Ê
«Ü¨ØªA«D¨Ï¥ÎªÌªºG¤j¡A¯à¼g¥X²Å¦X¹ê»Ú¥Î³~¤S¦p¦¹Â²¬ù¦³®Ä²vªºµ{¦¡½X¡I
¤p§Ì¥\¤O©|²L¼g¥Xªºµ{¦¡«Ü²ÊÁW¡A¹ïG¤jµ{¦¡½X¼È®É¥u¯à±æ¦Ó¿³¹Ä¡AºCºC¬ã¨s°Ú- Sub ¶×¥X¦a½S¸ê®Æ¨ì·s¤u§@ªí()
-
- shn = ActiveSheet.Name
-
- '¨¾§b1
- For e = 2 To Sheets.Count
- If shn & "¶×¥X" = Sheets(e).Name Then
- Application.DisplayAlerts = False
- Sheets(shn & "¶×¥X").Delete
- Application.DisplayAlerts = True
- Exit For
- End If
- Next
-
- Application.ScreenUpdating = False
-
- Worksheets.Add after:=Worksheets(Sheets.Count)
- Worksheets(Sheets.Count).Name = shn & "¶×¥X"
- '§ì¨úÄæ¦ì ·s¼W
- Worksheets(shn).Select
- Range("A1:AM15").Select
- Range("A1:AM15").Copy
- Worksheets(Sheets.Count).Select
- Range("A1").Select
- Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
- SkipBlanks:=False, Transpose:=False
- ActiveSheet.Paste
- '§ì¨ú¨C¶¸ê®Æ¤º®e(¨Ï¥Î°j°é)
- Worksheets(shn).Select
- Dim i As Integer, j As Integer
- j = Range("AT51").Value
-
- For i = 16 To 16 + j * 52 Step 52 'À³nJ-1, ¦ýY¥u¦³¤@¶·|¦³¿ù¡A¦h¶×¥X¤@¶¨S®t
- Worksheets(shn).Select
- Range("a" & i & ":am" & i).Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- Selection.Copy
- Worksheets(Sheets.Count).Select
- If Worksheets(Sheets.Count).Range("F16") = "" Then
- Range("A16").Select
- ActiveSheet.Paste '¥ý¶K¤@¦¸§t¤½¦¡
- Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, _
- SkipBlanks:=False, Transpose:=False '¦A¶K¤@¦¸§â¤½¦¡®³±¼
- Range("F16").End(xlDown).Offset(1, -5).Clear '§R°£AÄæ¸ê®Æ,¥H§Q¶K¤W¸ê®Æ³sÄò
- Else
- Worksheets(Sheets.Count).Range("F16").End(xlDown).Offset(1, -5).Select
- ActiveSheet.Paste '¥ý¶K¤@¦¸§t¤½¦¡
- Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
- xlNone, SkipBlanks:=False, Transpose:=False '¦A¶K¤@¦¸§â¤é´ÁÅܬ°¤å¦r
-
- End If
- Next
- end sub
½Æ»s¥N½X |
|