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

[µo°Ý] ½Æ»s¸ê®ÆÂà¼g¨ì¥t¤@¤u§@ªí

¦^´_ 4# yliu
  1. Private Sub CommandButton1_Click()
  2.     Dim rowcnt&, rowcnt_login&
  3.     Dim g As Integer, §Ç¸¹ As Range, I As Integer
  4.     Set §Ç¸¹ = Sheets("login").[B9:J19]                             'ª«¥ó : ³]©w½Æ»sªº½d³ò
  5.     g = Application.CountA(Sheets("final").[A:A]) + 1               'Ū¨úAø󦳸ê®Æ¼ÆªºÀx¦s®æ¼Æ +1
  6.     I = 1
  7.     Do Until §Ç¸¹.Range("A" & I) = "" Or I > §Ç¸¹.Rows.Count
  8.          '½d³ò ªº Range("A" & I)->½d³òªº"A"øó  ,Rows.Count;½d³ò¦C¼Æªº­pºâ
  9.         With Sheets("final")
  10.             .Cells(g, "A") = Sheets("login").ComboBox1.Value
  11.             .Cells(g, "B").Resize(1, §Ç¸¹.Columns.Count) = §Ç¸¹.Rows(I).Value
  12.             g = g + 1
  13.             I = I + 1
  14.         End With
  15.     Loop
  16. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# yliu
  1. Private Sub CommandButton1_Click()
  2.     Dim g As Integer, E As Range
  3.     g = Application.CountA(Sheets("final").[A:A]) + 1               'Ū¨úAø󦳸ê®Æ¼ÆªºÀx¦s®æ¼Æ +1
  4.     For Each E In Sheets("login").[B9:B19]
  5.         If E = "" Then Exit For
  6.         With Sheets("final")
  7.             .Cells(g, "A") = Sheets("login").ComboBox1.Value
  8.             .Cells(g, "B").Resize(1, 2) = E.Resize(1, 2).Value
  9.             .Cells(g, "D").Resize(1, 6) = E.Cells(1, 4).Resize(1, 6).Value
  10.         End With
  11.         g = g + 1
  12.     Next
  13. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 9# yliu
  1. Private Sub CommandButton1_Click()
  2.     Dim g As Integer, E As Range, C As Range, ³æ¸¹ As String, SS As String, Rng As Range
  3.     Dim i As Integer
  4.     With Sheets("login")
  5.         ³æ¸¹ = .ComboBox1.Value
  6.         Set Rng = .[B9:B19]
  7.         SS = Application.Phonetic(Rng)                                                  'µ²¦X©Ò¦³§Ç¸¹
  8.     End With
  9.    
  10.     With Sheets("final").[A:A]
  11.         If Application.CountIf(.Cells, ³æ¸¹) > 1 Then
  12.             .Replace ³æ¸¹, "=xxx", xlWhole                                               ''Replace ¤èªk
  13.             With .SpecialCells(xlCellTypeFormulas, xlErrors)
  14.                 .Cells = ³æ¸¹
  15.                 For Each C In .Cells                                                     ''¤ñ¹ï¨ì §Ç¸¹ ½ð°£ ¦¹§Ç¸¹
  16.                     If InStr(SS, C.Offset(, 1)) Then SS = Replace(SS, C.Offset(, 1), "") 'Replace ¨ç¼Æ
  17.                     If SS = "" Then Exit Sub
  18.                 Next
  19.             End With
  20.         End If
  21.         For Each E In Rng
  22.             If E = "" Then Exit For
  23.             If InStr(SS, E) Then                                              '¤ñ¹ï¨ì §Ç¸¹
  24.                 g = Application.CountA(.Cells) + 1                            'Ū¨úAø󦳸ê®Æ¼ÆªºÀx¦s®æ¼Æ +1
  25.                 i = Application.CountA(Rng)
  26.                 .Cells(g, "A").Resize(1) = ³æ¸¹
  27.                 .Cells(g, "B").Resize(1, 2) = E.Cells(1).Resize(1, 2).Value
  28.                 .Cells(g, "D").Resize(1, 6) = E.Cells(1, 4).Resize(1, 6).Value
  29.             End If
  30.         Next
  31.     End With
  32. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-4 11:14 ½s¿è

¦^´_ 12# yliu
  1. Private Sub ListBox2_Change()
  2.     Dim lrow, irow, ai As Integer, AR, S As String
  3.     With ListBox1
  4.         AR = .List  '.List-> ( 0 TO .ListCount - 1, 0 TO  9)   ListBoxªºColumnCount ÄÝ©Ê ³Ì¦h¥u¯à¦³ 10 ¦æ (0 ¨ì 9)¡C
  5.                     '³oListBox1¥u¦³4¦æ¸ê®Æ,«á­±ªº5¦æ-9¦æ = Null,¨Ï¥ÎIndex ¨ç¼Æ·|¿ù»~
  6.         If .ListCount > 0 Then ReDim Preserve AR(0 To .ListCount - 1, 0 To .ColumnCount - 1)   '®ø°£ «á­±ªº5¦æ-9¦æªº Null
  7.         For lrow = 0 To .ListCount - 1
  8.             If .Selected(lrow) Then
  9.                 S = S & Join(Application.Index(AR, lrow + IIf(UBound(AR) = 0, 0, 1)), "")       '¬ö¿ý¤w¤Ä¿ïªº¸ê®Æ
  10.             End If
  11.         Next
  12.         .Clear
  13.     End With
  14.     [A9:E19] = ""
  15.     With ListBox2
  16.         For lrow = 0 To .ListCount - 1
  17.             If .Selected(lrow) Then
  18.                 With Sheets(Sh)
  19.                     ai = 2
  20.                     Do While .Cells(ai, "A") <> ""
  21.                         If .Cells(ai, "A") = ListBox2.List(lrow, 0) Then
  22.                             With ListBox1
  23.                                 .AddItem
  24.                                 irow = .ListCount
  25.                                 .List(irow - 1, 0) = Sheets(Sh).Cells(ai, "A")
  26.                                 .List(irow - 1, 1) = Sheets(Sh).Cells(ai, "B")
  27.                                 .List(irow - 1, 2) = Sheets(Sh).Cells(ai, "C")
  28.                                 .List(irow - 1, 3) = Sheets(Sh).Cells(ai, "D")
  29.                                 .List(irow - 1, 4) = Sheets(Sh).Cells(ai, "E")
  30.                                 If InStr(S, Application.Phonetic(Sheets(Sh).Cells(ai, "A").Resize(, 5))) Then '¤ñ¹ï: ¬ö¿ý¤w¤Ä¿ïªº¸ê®Æ
  31.                                     .Selected(.ListCount - 1) = True
  32.                                 End If
  33.                             End With
  34.                         End If
  35.                         ai = ai + 1
  36.                     Loop
  37.                 End With
  38.             End If
  39.         Next
  40.     End With
  41. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 23# yliu
½Ð­×§ï¦p¤U
Dim lrow, irow, ai As Integer, AR(), S As String -> Dim  AR
If UBound(AR) > -1 Then ReDim    ->  If .ListCount > 0 Then ReDim
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD