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

[µo°Ý] ¦U¦ì¦Ñ®vvba §ïµ½Àò¨ú«ü©w­¶ªºµ{¦¡¤º¦³µ{§Ç¥N½X!

[µo°Ý] ¦U¦ì¦Ñ®vvba §ïµ½Àò¨ú«ü©w­¶ªºµ{¦¡¤º¦³µ{§Ç¥N½X!

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-19 15:00 ½s¿è
  1. Private Sub OptionButton1_Click() 'for default page
  2. Dim Arr(1 To 20) As String
  3. 'Dim thisworkbook As Workbook

  4. Arr(1) = "xxx1109"
  5. Arr(2) = "xxx1160"
  6. Arr(3) = "xxx1150"
  7. Arr(4) = "xxx1110"
  8. Arr(5) = "xxx1130"
  9. Arr(6) = "xxx1141"
  10. Arr(7) = "xxx1171"
  11. Arr(8) = "xxx1172"
  12. Arr(9) = "xxx1173"
  13. Arr(10) = "xxx1176"
  14. Arr(11) = "xxx1174"
  15. Arr(12) = "xxx1175"
  16. Arr(13) = "xxx1623"
  17. Arr(14) = "xxx1180"
  18. Arr(15) = "xxx1201"
  19. Arr(16) = "xxx1610"
  20. Arr(17) = "xxx1621"
  21. Arr(18) = "xxx1622"
  22. Arr(19) = "xxx1630"
  23. Arr(20) = "xxx1710"
  24. For A = 1 To 20
  25. UserForm1.ListBox2.AddItem (Arr(A))
  26. Next A

  27. End Sub
½Æ»s¥N½X
¦U¦ì¦Ñ®v,§Ú·Q¿ï¨ú«ü©wªºexcel­¶,¦@¦³20­¶

§Ú²{¦b¼gªº¤èªk¬O©w¤FÀɦW​​arr(1)xxx1109,

Á|¨Ò²Ä¤@­Ó¬Oxxx1109,·í­¶¦W¬Oxxx1109


´N·|¦bListBoxÅã¥Ü,¦ýxxx¬O·|Åܰʪº,¼Æ¦r´N¤£·|ÅÜ

xxx¤@Âà,¦p§ï¦¨­¶¦Wzzzz1109 §Ú´N¿ï¨ú¤£¨ì¤F

¦³¤èªk¥Î·j¬d¼Æ¦r,±q¦Ó¿ï¨úxxx1109/zzzz1109¶Ü?


§Úªº·N«ä´N¬O¹M¾ú©Ò¦³ªí®æ¦WºÙ
µM«á´£¨ú¨C­Óªí¦WºÙ³Ì«áªº¥|­Ó¦r²Å¶i¦æ¤Ç°t¡A¦A²K¥[¶i¦Cªí¡C
½Ð°Ý¦U¦ì¥i¥H¼gµ{§Ç¥N½X¥X¨Ó±Ð±Ð§Ú¶Ü??


¤W¶Ç¤Fªþ¥ó,¨D±Ð

UserForm1.rar (1.7 KB)

¦n,ÁÂÁ§ڷ|§V¤O¬ã¨s!

TOP

¦^´_ 18# marco2000

ª©¤j¤£À´ªº¦a¤è³£«ü¦VÅܼƦWºÙ¤W¡AÅܼƦWºÙ¥iÀH·N©R¦W(¦ý»ÝÁ׶}VBAªºÃöÁä¦r)¡A
Åܼƥu¬O­Ó®e¾¹¡A¥i¸Ë¸ü©Ò»Ýªº¸ê°T¡A¨Ã¥iÀH®É§ó§ï®e¾¹¤ºªº¸ê°T¨Ó°µ¦³®Äªº¹B¥Î¡C

­Y­n§¹¥þ¤F¸ÑÅܼƦp¦ó¹B§@¡A°£¤FGBKEE¶W¯Åª©¥D´£¥Xªº¤èªk¤§¥~¡A«Øij¥h¶R¥» Excel VBA °ò¥»±Ð¬ì®Ñ¨Ó¬ã¨s§a¡C
[b]Kubi[/b]

TOP

¦^´_ 17# marco2000
ÁÂÁ§A,§Úª¾¹D¦³¤°»ò¥Î,¦ý¬Ý¤£©úµ{§Ç¥N½X
¦]¬°§Ú·Q¶i¦æ­×§ï,¦ý¬Ý¤£©ú¥Õ¥N½X,¥H­P§ó§ï¤£¨ì

ù°¨¤£¬O¤@¤Ñ³y¦¨ªº,§i¶D§A¥N½X¬O¤°»ò·N¸q,§A¤]¤£¨£±o´N·|¶i¦æ­×§ï
¦Ñ¥Í±`½Í: §A¤£À´ªºµ{¦¡½X¥i¦bvbaµøµ¡¤¤ªº»¡©ú¾é¸Ñ,¥i½Æ»s¥¦ªº½d¨Ò
          ¦h¬Ý¦h½m²ß,¯u¦³ºÃ°Ý¦Aµo°Ý¤£¿ð

¦p¹Ï·Æ¹«¿ï¨ú¤å¦r, «á«ö F1»¡©úÁä

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

TOP

rr = 7                                           rr=7¬O¤°»ò·N«ä?
    For c = 1 To lb2                             ³o­Ó¬Olistbox2ªºÀÉ®×
        text1sl = UserForm1.ListBox2.List(c - 1)                         text1sl ¬O¤°»ò
        pp = rr + 2                                         
        kk = checkrow                                   Àˬd¾î¨Ò??
        arn = "C8" & ":" & "Z" & kk                                   arn¬O¦³¤°»ò¥Î?":"¬O¥Î¨Ó³s±µ?
        ActiveWorkbook.Worksheets(text1sl).Range(arn).Copy
        rrn = "B" & rr                                                                 B??
        ThisWorkbook.Sheets(1).Range(rrn).PasteSpecial
        rr = rr + kk - 5                                                   
        
        arn2 = "A" & pp & ":" & "A" & (rr - 3)                          'for fill "A" column
        ThisWorkbook.Sheets(1).Range(arn2) = ActiveWorkbook.Worksheets(text1sl).Cells(8, 3)

TOP

¦^´_ 16# Kubi


ÁÂÁ§A,§Úª¾¹D¦³¤°»ò¥Î,¦ý¬Ý¤£©úµ{§Ç¥N½X
¦]¬°§Ú·Q¶i¦æ­×§ï,¦ý¬Ý¤£©ú¥Õ¥N½X,¥H­P§ó§ï¤£¨ì

TOP

¦^´_ 15# marco2000

¤j·§¬O»¡±q§@¥Î¤¤¬¡­¶Ã¯¤º¡A¨Ì§Ç±q²M³æ¤è¶ô(ListBox2)¤º¿ï³æ©Ò¦³¦C¥Üªº¤u§@ªí¦WºÙ¡A´`Àô½Æ»s¸Ó¤u§@ªíC¡ãZÄæ½d³ò¤ºªº¸ê®Æ¡A¦Ü¥»¬¡­¶Ã¯¤º¬Û¦P¤u§@ªí¦WºÙªºBÄ椺¡C

¦]¤£¬O­ìµÛ¤]¨S¦³­ìÀÉ®×¥i°Ñ·Ó¡A¥i¯à·|¦³¨Ç¥¢·Ç¡A³Ì¦n¬O§ä¨ì­ìµÛ¡A½Ð¥L¨Ó¸ÑÄÀ¸û§´¡C
[b]Kubi[/b]

TOP

¦^´_ 13# Kubi
  1.     ThisWorkbook.Sheets(1).UsedRange.Clear
  2.     lb2 = UserForm1.ListBox2.ListCount
  3.    
  4.     rr = 7
  5.     For c = 1 To lb2
  6.         text1sl = UserForm1.ListBox2.List(c - 1)                        'for copy content
  7.         pp = rr + 2
  8.         kk = checkrow
  9.         arn = "C8" & ":" & "Z" & kk
  10.         ActiveWorkbook.Worksheets(text1sl).Range(arn).Copy
  11.         rrn = "B" & rr
  12.         ThisWorkbook.Sheets(1).Range(rrn).PasteSpecial
  13.         rr = rr + kk - 5
  14.         
  15.         arn2 = "A" & pp & ":" & "A" & (rr - 3)                          'for fill "A" column
  16.         ThisWorkbook.Sheets(1).Range(arn2) = ActiveWorkbook.Worksheets(text1sl).Cells(8, 3)
  17.     Next c
  18.    
½Æ»s¥N½X
¤j¤j§A¬Ý±o©ú¶Ü?
¥i¥H¸ÑÄÀ¤@¤U¶Ü?

TOP

¦^´_  marco2000


½Ð©ó¶}©l¤§ Private Sub CommandButton3_Click()

»P ThisWorkbook.Sheets(1).Use ...
Kubi µoªí©ó 2014-2-18 19:53


¸Õ¤F,¥þ¹ï
§Ú´N¬O·Q­n³o¼Ë,«Ü·P¿E§Aªº¤@¾ã¤ÑÀ°§U:D

TOP

¦^´_ 12# marco2000


½Ð©ó¶}©l¤§ Private Sub CommandButton3_Click()

»P ThisWorkbook.Sheets(1).UsedRange.Clear

¨â¦æ¤¤¶¡´¡¤J©³¤Uªº§PÂ_¦¡¡A¸Õ¬Ý¬Ý¡C

sn = UserForm1.ListBox2.ListCount
If sn = 0 Then
    MsgBox "¨Ã¨S¦³¿ï¨ìÀÉ®×", vbCritical + vbOKOnly, "½Ð­«¿ï"
    Exit Sub
Else
    If MsgBox("¿ï¤F " & sn & " ­ÓÀɮסA¬O§_½T©w­n°õ¦æ¡H", vbQuestion + vbYesNo, "½Ð½T»{") = vbNo Then Exit Sub
End If
[b]Kubi[/b]

TOP

        ÀR«ä¦Û¦b : §g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí ¤W¤@¥DÃD