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

[µo°Ý] «ç»ò¦bUSERFORM¤¤¥[¤J¥i¿z¿ï½Æ¿ï¤§¾ðª¬¹Ï

¤j¤j¥i¯à ¦b module º|¼g   Public vD  ???

TOP

  Public vD  as object
'
    Private Sub CommandButton1_Click()
        If Application.FindFile = False Then
            MsgBox "±z¨S¦³¶}±Ò¥ÀÀÉ"
        End If

        Dim lRow&
      
      if vD is nothing then  Set vD = CreateObject("Scripting.Dictionary")
        lRow = 3
        vD.RemoveAll
        While Cells(lRow, 1) <> ""
          If Not vD.Exists(CStr(Cells(lRow, 1))) Then
            EXCELªí³æ³B²z¤¶­±.ListBox1.AddItem CStr(Cells(lRow, 1))
            vD(CStr(Cells(lRow, 1))) = lRow
          End If
          lRow = lRow + 1
        Wend
    End Sub

TOP

¦^´_ 13# luhpro

¤j¤j»¡ªº "§Úµo²{ Excel ¤W¨Ã¤£¯à¥Î¤@­Ó Is Nothing ´N¥]¿ì©Ò¦³³oÃþª«¥ó¿ù»~ªº§PÂ_"

¦pªG§â Public vD  §ï¦¨ Public vD  as object

ÁÙ·|¥X²{  Is Nothing  µo¥Í°ÝÃD¶Ü

ÆZ¦n©_ªº

¦pªG¬O¥Î Public vD  
¤£¥Î On Err ¥i¥H¼g¦¨
if  isObject( vD )  then
    if   vD  is Nothing  then
    end if
end if

TOP

¦^´_ 15# GBKEE


    http://forum.twbts.com/redirect. ... 0&fromuid=21301

§Ú¦³§ï¥¿©ã   cc....

TOP

¦^´_ 39# chaoyiho


    ¨º­Ó°T®§¥Nªí2·N¸q
(1) ª«¥ó¤£¦s¦bµù¥Uªí¤¤
(2) §A¥i¯à¥´¿ù¦W
µª®×=(2)
Set a = CreateObject("scripting.dictionary")

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-4-28 09:12 ½s¿è

¦^´_ 44# chaoyiho


Set vD = CreateObject("scripting.dictionary")

§A¤Ö¤F¤@­Ó   i


¥t¥~ LongPtr  
¥Î long ´N¥i¥H¤F

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-4-28 09:30 ½s¿è

EXCELªí³æ³B²z¤¶­± ¸Ì­±ªº

Private Sub UserForm_Initialize()

Dim hWndForm As LongPtr
Dim IStyle As LongPtr

Set vD = CreateObject("scripting.dictonary")

§ï¦¨¦p¤U

Private Sub UserForm_Initialize()

Dim hWndForm As Long
Dim IStyle As Long

Set vD = CreateObject("scripting.dictionary")


¦sÀÉ«á , Ãö³¬¦A­«¶}±Ò

§ï§¹«á §Ú³oÃä°õ¦æ´Nok ¤F°Ú

TOP

¥t¥~
§â EXCELªí³æ³B²z¤¶­± ¸Ì­±ªº²Ä¤@¦æ   Option Explicit  ¼È®É¥ý®³±¼

TOP

¦A¥t¥~
§â EXCELªí³æ³B²z¤¶­± ¸Ì­±ªº³o¬q ¥[¤JÂŦr³¡¤À

Private Sub CommandButton1_Click()
    If Application.FindFile = False Then
        MsgBox "±z¨S¦³¶}±Ò¥ÀÀÉ"
    End If
Dim lRrow&
    lRrow = 3
vD.RemoveAll
While Cells(lRow, 5) <> ""
      If Not vD.Exists(CStr(Cells(lRow, 5))) Then
        EXCELªí³æ³B²z¤¶­±.ListBox1.AddItem CStr(Cells(lRow, 5))
        vD(CStr(Cells(lRow, 5))) = lRow
      End If
      lRow = lRow + 1
End With
End Sub

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-4-28 10:26 ½s¿è

¦^´_ 52# chaoyiho


#51 ¼Ó §Ú¬Ý¿ù¤F  ( While  ¬Ý¦¨ With )
§ó¥¿¤@¤U
¤j¤j¯uªº¬O¨Ó¦Ò¤j®a²´¤Oªº ( §ä¤£¦Pªº¹CÀ¸ ?? )

Private Sub CommandButton1_Click()
    If Application.FindFile = False Then
        MsgBox "±z¨S¦³¶}±Ò¥ÀÀÉ"
    End If
Dim lrow&   ' c_c_lai ¤j¤j§ä¥X
    lrow = 3
vD.RemoveAll
While Cells(lrow, 5) <> ""
      If Not vD.Exists(CStr(Cells(lrow, 5))) Then
        EXCELªí³æ³B²z¤¶­±.ListBox1.AddItem CStr(Cells(lrow, 5))
        vD(CStr(Cells(lrow, 5))) = lrow
      End If
      lrow = lrow + 1
Wend
End Sub

TOP

        ÀR«ä¦Û¦b : ¬O«D·í±Ð¨|¡AÆg¬ü§@ĵ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD