ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý¦p¦ó§âµL¸ê®Æªº¦h¾l­¶­±³]©w¤@«ö¶s§R°£

  1. Sub ¶×¥X¦a½S¸ê®Æ¨ì·s¤u§@ªí()
  2. Dim vSht As Worksheet, R&, vR As Range, SHN$, xSht As Worksheet

  3. Set vSht = ActiveSheet: SHN = vSht.Name & "¶×¥X"
  4. On Error Resume Next: Set xSht = Sheets(SHN): On Error GoTo 0
  5. If xSht Is Nothing Then Set xSht = Sheets.Add(after:=Sheets(Sheets.Count))

  6. With xSht
  7.      .Name = SHN:  .Cells.Clear '­«©R¦W, ²M°£¤º®e
  8.      R = Val(vSht.[AT51]) * 52: If R = 0 Then Exit Sub '¨ú±o­¶¼Æ
  9.      vSht.Range("A1:AM" & R).Copy .[A1] '¶K¤W¸ê®Æ
  10.      .Range("A16:A" & R) = "=TEXT(COUNT(AK$16:AK16),""'000"")" '§Ç¸¹¤½¦¡
  11.      .Range("A1:AM" & R) = .Range("A1:AM" & R).Value '¥þ³¡¤º®e¶K¦¨­È
  12.      For Each vR In vSht.[A1:AM1]
  13.          .Range(vR.Address).ColumnWidth = vR.ColumnWidth 'Äæ¼e
  14.      Next
  15. End With

  16. On Error Resume Next
  17. With xSht.Range("AK16:AK" & R)
  18.      .SpecialCells(xlCellTypeConstants, 22).EntireRow.Delete '§R°£¡e¤å¦r¡f®æ¾ã¦C
  19.      .SpecialCells(xlCellTypeBlanks).EntireRow.Delete  '§R°£¡eªÅ¥Õ®æ¡f¾ã¦C
  20. End With
  21. On Error GoTo 0

  22. xSht.Select
  23. End Sub
½Æ»s¥N½X
¡@
Xl0000046.rar (144.56 KB)
¡@
¡@

TOP

¨Sª`·N­ìªí¤½¦¡°Ñ·Ó®æ¦b½Æ»s½d³ò¤§¥~¡A­×§ï¤@¤U¡G

With xSht
¡@¡@¡@.Name = SHN:  .Cells.Clear '­«©R¦W, ²M°£¤º®e
¡@¡@¡@.[BK3] = vSht.[BK3].Value
¡@¡@¡@.[AV1] = vSht.[AV1].Value

¡@¡@¡@.[BI3] = vSht.[BI3].Value
¡@¡@¡@R = Val(vSht.[AT51]) * 52: If R = 0 Then Exit Sub '¨ú±o­¶¼Æ
¡@¡@¡@vSht.Range("A1:AM" & R).Copy .[A1] '¶K¤W¸ê®Æ
¡@¡@¡@.Range("A16:A" & R) = "=TEXT(COUNT(AK$16:AK16),""'000"")" '§Ç¸¹¤½¦¡
¡@¡@¡@.Range("A1:AM" & R) = .Range("A1:AM" & R).Value '¥þ³¡¤º®e¶K¦¨­È
¡@¡@¡@For Each vR In vSht.[A1:AM1]
¡@¡@¡@¡@¡@.Range(vR.Address).ColumnWidth = vR.ColumnWidth 'Äæ¼e
¡@¡@¡@Next
¡@¡@¡@.[BK3] = "": .[AV1] = "": .[BI3] = ""
End With

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-10-9 20:05 ½s¿è

¦^´_ 15# simplehope


.SpecialCells(xlCellTypeConstants, 22).EntireRow.Delete '§R°£¡e¤å¦r¡f®æ¾ã¦C
¥Îªº¬O¥\¯àªí¡G½s¿è¡Ö¨ì¡Ö¯S®í¡]¨ä¥¦ª©¥»¥i¯à¤£¦P¡A§ä¬Ý¬Ý¡^¡@¡@


¦]¬°AKÄ榳®Ä¤º®e¬°¡e¼Æ­È¡f¡A©Ò¥H¥u­n±N¡e¤å¦r¡f¤Î¡eªÅ®æ¡f¾ã¦C®³±¼¡A³Ñ¤Uªº´N¬O©Ò»Ý¡G¡@
¡@¡@

¨Ï¥Î¡e¿ý»s¡f´N¥i¥H¨ú±oµ{¦¡½X¡]­n¿ý¨â¦¸¡^¡I¡@
¡@
¨Ï¥Î³o¥\¯à®É¡A­Y¿ï¨ú½d³ò¤¤¨S¦³¤å¦r¤ÎªÅ®æ¡Aµ{¦¡·|µo¥Í¿ù»~¦Ó¤¤Â_¡A
©Ò¥H«e­±¥[­Ó¡@On Error Resume Next ¡]²¤¹Lµ{¦¡¿ù»~Ä~Äò°õ¦æ¡^¡A
³o¬O¤w¹wª¾¤U¨â¦æµ{¦¡¥i¯à¦³¿ù»~µo¥Í«e´£¤U©Ò¥[ªº¡A
·í¨º¨â¦æµ{¦¡°õ¦æ§¹²¦¡A¥²¶·Åýµ{¦¡«ì´_¡e°»¿ù¡fªº¥\¯à¡A
©Ò¥H¦A¥[¡@On Error GoTo 0¡@¡]«ì´_°»¿ù¡^¡A
§_«h«á­±ªºµ{¦¡­Y¦³¿ù»~±NµL±q±oª¾¡A¤]¦]¦¹¥i¯à³B²z¥X¨Óªº¸ê®Æ¨Ã¤£¥¿½T¡A¦ÓµL¿ù»~´£¥Ü¡A
¤W¤@¬qªº¡G
On Error Resume Next
Set xSht = Sheets(SHN)¡@¡Ö¡@­Y¤u§@ªí¤£¦s¦b¡A¹w³]±N´£¥Ü¿ù»~¡A¦¹®É´£¥Ü´N²¤¹L¤F
On Error GoTo 0
¡@
¡@

TOP

¦^´_ 16# simplehope


¤½¦¡°Ñ·Ó¨Ã¥¼±a¤u§@ªí¦WºÙ¤Þ¼Æ¡A
¦]¦¹¶K¦Ü¨ä¥¦ªí®É¡A¥¦°Ñ·Óªº¬O¥»¨­ªíªºÀx¦s®æ¡A
¦ý³oªíªº°Ñ·Ó®æ¬OªÅ¥Õªº¡A¤½¦¡­È·íµM¬O¿ù»~ªº¡I

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-10-9 20:18 ½s¿è

¦^´_ 18# simplehope


±z²Ä¤@¦¸¬O¤½¦¡­ì½L¶K¹L¨Ó¡A¦A¶K¦¨­È¡A³o´N¬O°Ñ·Ó¿ò¥¢°ÝÃD¡A
±N­ìªí¢Ï¢ä¢°§ï¦¨¡e¨øÂd¡f¡A¦A°õ¦æ±z­ì¨Óµ{¦¡¡A
¤â¤u¥h¤ñ¹ï¨âªí¢Ü¡þ¢Þ¨âÄæ­pºâµ²ªG¬Ý¬Ý¡I¡I¡I

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD