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

[µo°Ý] ¦p¦ó¥ÎVBAÅý¤½¦¡½Æ¨î¨ì¤u§@ªí¦³¸ê®Æªº³Ì«á¤@¦C

¦^´_ 1# PJChen

½Ð°Ý¤@¤U°w¹ï²Ä¤G­Ó°ÝÃD:
±z¬O§Æ±æEÄæ¤@ª½«ùÄò¥[1¡A¤]´N¬O488¡A489¡A490...
ÁÙ¬O´N483~487¤@ª½´`Àô?
¤£¬O«ÜÀ´½Æ»sªº·N«ä?
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 3# PJChen

¤£ª¾¹D³o¼Ë²Å¤£²Å¦X±zªº»Ý¨D
  1. Sub test()

  2. lastRow1 = Cells(Rows.Count, "F").End(xlUp).Row
  3. lastRow2 = Cells(Rows.Count, "A").End(xlUp).Row
  4. If lastRow2 <> lastRow1 Then
  5. Range("A" & lastRow2 & ":" & "C" & lastRow2).AutoFill Destination:=Range("A" & lastRow2 & ":C" & lastRow1)
  6. For i = lastRow2 To lastRow1 - 1
  7.     Cells(i + 1, "E") = Cells(i, "E") + 1
  8. Next
  9. End If
  10. End Sub
½Æ»s¥N½X
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¥»©«³Ì«á¥Ñ iamaraymond ©ó 2018-5-14 22:38 ½s¿è

¦^´_ 5# PJChen

·Q¥ý½T»{¤@¤U±zªº°ÝÃD:
±z¬O»¡·í°õ¦æVBA«ü¥O¸Ìªºµ{¦¡®É
1.­Y¦¹®É"¦Û°Ê½Æ»s"ÃöµÛ¡A«h¥i¥H°õ¦æ©¹¤U¦Û°Ê¶ñº¡
2.­Y¦¹®É"¦Û°Ê½Æ»s"¶}µÛ¡A´N¨S¦³°Ê§@
©Ò¥H±z§Æ±æ·í"¦Û°Ê½Æ»s"¶}µÛ®É¡A¤]¥i¥H©¹¤U¦Û°Ê¶ñº¡?
¤£ª¾¹D§Úªº²z¸Ñ¥¿¤£¥¿½T

±zªº²Ä¤G­Ó°ÝÃD¬O§Æ±æ"¦Û°Ê½Æ»s"ªºE2=1¡AE3=2¡A¤@ª½¨ì¥Ø«e³Ì«á¤@¦CE11¶Ü?
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 7# PJChen

³o¼Ë¶Ü?
  1. With Wb.Sheets("­q³æ¥X³f")
  2.    
  3.     lastRow1 = .Cells(Rows.Count, "G").End(xlUp).Row  '¥HGÄ檺¸ê®Æ¦C¬°°ò·Ç
  4.     lastRow2 = .Cells(Rows.Count, "A").End(xlUp).Row '¥HAÄ檺¸ê®Æ¦C¬°°ò·Ç
  5.     lastRow3 = .Cells(Rows.Count, "BL").End(xlUp).Row '¥HBLÄ檺¸ê®Æ¦C¬°°ò·Ç
  6.     lastRow4 = .Cells(Rows.Count, "BP").End(xlUp).Row '¥HBPÄ檺¸ê®Æ¦C¬°°ò·Ç
  7.    
  8.     If lastRow2 <> lastRow1 Then
  9.     .Range("A" & lastRow2 & ":" & "C" & lastRow2).AutoFill Destination:=.Range("A" & lastRow2 & ":C" & lastRow1)  '·íAÄæ³Ì«á¤@¦C¤£µ¥©óGÄæ®É,A:C¦Û°Ê©¹¤U¶ñº¡

  10.     For i = 2 To lastRow1
  11.     .Cells(i, "E") = i - 1
  12.     Next
  13.     End If
  14.    
  15.     If lastRow3 <> lastRow1 Then
  16.     .Range("BL" & lastRow3 & ":" & "BN" & lastRow3).AutoFill Destination:=.Range("BL" & lastRow3 & ":BN" & lastRow1)  '·íBLÄæ³Ì«á¤@¦C¤£µ¥©óGÄæ®É,¦Û°Ê©¹¤U¶ñº¡
  17.    
  18.     End If

  19.     If lastRow4 <> lastRow1 Then
  20.     .Range("BP" & lastRow4 & ":" & "CX" & lastRow4).AutoFill Destination:=.Range("BP" & lastRow4 & ":CX" & lastRow1)  '·íBPÄæ³Ì«á¤@¦C¤£µ¥©óGÄæ®É,¦Û°Ê©¹¤U¶ñº¡
  21.    
  22.     End If

  23. End With
½Æ»s¥N½X
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 9# PJChen
¨ä¹ê¥u¬OÀ°±z¥[­Ó"."¦Ó¤wXD
¥Îwithªº®É­Ô­n¨Ï¥Î"."¤~¥i¥H¨Ï¥Î¸Óª«¥ó
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD