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

¼g¤@­Ó¥t¦s·sÀɪº¥¨¶°¡A¦ý¬O»Ý­n.pdf file¡A¨º»òÀ³«ç§ï¼g¡H

¦^´_ 30# Blade
¬O³o¼Ë¶Ü?
  1. Option Explicit
  2. Sub Ex()
  3.     Selection.Resize(, 3).Copy Sheets("invoice").Range("L7")
  4.    
  5.     'Selection.Resize(, 3).Copy    :½d³òªº½Æ»s
  6.     'Sheets("invoice").Range("L7") :¶K¤Wªº¦ì¸m
  7.     '
  8.     Sheets("invoice").Activate
  9.     Sheets("invoice").Range("K7").Select
  10.    
  11. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  Blade
¬O³o¼Ë¶Ü?
GBKEE µoªí©ó 2014-1-17 06:52


·PÁª©¤jªº«ü±Ð¡C
§Ú·Q°Ý°Ý¡A(, 3)¬O¬Æ»ò·N«ä¡H
½d³ò¬OA&Bªº¿ï©w¡A¦pªG¬OA-F¡A¨º»ò¬O§_­×§ï¦¨(, 5....6)¡A¦p¦¹Ãþ±À¡H

TOP

Sheets("invoice").Range("L7")
¥t¥~·Q½Ð±Ð¡A¥H¤Wªº«ü¥O¡A¬O¶K¤W L7ªº¡A«ç¼Ë¥i³]©wµL«ü¦Vªº«ü¥O¡H

TOP

¦^´_ 33# Blade
Selection.Resize(¦C¼Æ, Äæ¼Æ).Copy Sheets("invoice").Range("L7")
¬Ù²¤ ¦C¼Æ =¦PSelectionªº¦C¼Æ
¬Ù²¤ Äæ¼Æ =¦PSelectionªºÄæ¼Æ

§A»¡:«ç¼Ë¥i³]©wµL«ü¦Vªº«ü¥O
¤°»ò¬OµL«ü¦V»¡©ú¤@¤U
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  Blade
Selection.Resize(¦C¼Æ, Äæ¼Æ).Copy Sheets("invoice").Range("L7")
¬Ù²¤ ¦C¼Æ =¦PSelectio ...
GBKEE µoªí©ó 2014-1-17 19:37


·PÁ¡I
Selection.Resize §Ú§¹¥þ©ú¥Õ¤F¡C:)
§Ú¨£¬Ù²¤¤F¬O³o様 Selection.Resize(, 3)
¦pªG¡A§Ú¦C©MÄæ³£¬Ù²¤¡ASelection.Resize(,)¬O§_³o様¡H

TOP

¥»©«³Ì«á¥Ñ Blade ©ó 2014-1-18 01:50 ½s¿è

¥ý¬Ý¬Ý¹Ï¤ù¡C
§Ú²{¦bÀ´±o¥ÎSelection.Resize¡C
§Ú¦P様¦a¦bcourse¨º­¶¡A³£°µ¤F«öÁäµ¹¨C¤@­Ó½Òµ{¡C
²{§Ú§ÚÀ´¤FSelection.Resize¡A§Ú·|¥Î¬Û¦P«ü¥O¥h³B²zcourse¨º­¶¡A¦ý¬Ocopy¨ìinvoice¡A¨º¸Ì§Ú¦³5¦æ¸ê®Æ¡C
¦pªG§Ú Copy Sheets("invoice").Range("B13")¡A¨º»ò¨C¦¸§Ú¿ïcourse¡A³£¥u¯àcopy¨ì B13¡A¥t¥~¨º4¦æ§ÚÀ³«ç½s¼g«ü¥O©O¡H
Copy Sheets("invoice").Range("B13") §ÚÀ³¥Î¬Æ»ò«ü¥O©O¡H

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.30.32.png (33.04 KB)

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.30.32.png

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.31.13.png (83.86 KB)

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.31.13.png

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.31.48.png (25.44 KB)

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.31.48.png

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.32.07.png (29.76 KB)

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.32.07.png

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.32.23.png (34.76 KB)

¿Ã¹õ§Ö·Ó 2014-01-18 ¤W¤È01.32.23.png

TOP

Selection.Resize(, 13).Copy Sheets("invoice").Selection.Resize(, 13)
Selection.Resize(, 13).Copy Sheets("invoice").Selection.Resize(, 1).Paste
Selection.Resize(, 13).Copy Sheets("invoice").Range("B13").Select

TOP

¦^´_ 35# Blade

§Ú¨£¬Ù²¤¤F¬O³o様 Selection.Resize(, 3)
¦pªG¡A§Ú¦C©MÄæ³£¬Ù²¤¡ASelection.Resize(,)¬O§_³o様¡H

¨º´N¤£»Ý¥ÎResize,ª½±µ¥ÎSelection
36#ªº¤º®e¬Ý¤£À´¬°¦ó¤£ª½±µ¤W¶ÇexcelÀÉ»¡©ú
37# Selection.Resize(, 13).Copy Sheets("invoice").Selection.Resize(, 13)
2003·|¿ù»~,­n§ï¦¨©ú½Tªº¦ì¸m¦p [A5] , ¥t«á­±.Paste .Select ¤]·|¦³¿ù»~,
§Aªºª©¥»¥i¥Î¶Ü?
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

§Úªº¬O2010

vba3.jpg (59.36 KB)

vba3.jpg

TOP

¥»©«³Ì«á¥Ñ Blade ©ó 2014-1-21 19:16 ½s¿è

·í§Ú¿ï¤F¡A«OÅ@¤u§@ªí¡A¥H¤Uµ{¦¡«K·|¥X¿ù»~¡C
  1. Sub InvoiceNo()
  2.     Dim xRNo As Range, i As Integer, y As Integer, R As Integer, RR As Integer
  3.     Set xRNo = Range("Q2")
  4.     'Set xRNo = Range("D5")
  5.     y = Len(xRNo)                                      '[µo²¼½s¸¹]ªº¦r¦ê­Ó¼Æ
  6.     For i = 1 To y
  7.         If R = 0 And Mid(xRNo, i, 1) Like "[0-9]" Then R = i    '§ä[µo²¼½s¸¹]¤¤²Ä¤@­Ó¼Æ¦r
  8.         If Mid(xRNo, i, 1) Like "[!0-9]" Then RR = i            '§ä[µo²¼½s¸¹]¤¤³Ì«áªº¤å¦r
  9.     Next
  10.     If RR > R Or R = 0 Or xRNo = 0 Then  '¼Æ¦r¦b¤å¦r¤§«e(©Î¥u¦³¤å¦r),¥u¦³¼Æ¦r
  11.         MsgBox "¡iª`·N¡j¦¬¾Ú½s¸¹¥X¿ù !!!"
  12.    Else
  13.         xRNo = Mid(xRNo, 1, R - 1) & Format(Mid(xRNo, R) + 1, String((y - R + 1), "0"))
  14.     End If
  15.    
  16.     Range("Q2").Select
  17.   'Range("D5").Select
  18.     Selection.Copy
  19.     Range("D6").Select
  20.     ActiveSheet.Paste
  21.     Application.CutCopyMode = False
  22.     With Selection.Font
  23.         .ColorIndex = xlAutomatic
  24.         .TintAndShade = 0
  25.     End With
  26.     Range("A4").Select
  27.      '¦p  y - R + 1 = 5
  28.      '¦p :Format(568, String((y - R + 1), "0")) => Format(568, "00000") => 5¦ì¼Æ:  00568
  29. End Sub
½Æ»s¥N½X
¥X¿ù»~ªº¥y¤l
  1.         xRNo = Mid(xRNo, 1, R - 1) & Format(Mid(xRNo, R) + 1, String((y - R + 1), "0"))
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD