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

[µo°Ý] (ÁÂÁ®¦®v­Ì¡A7/4§¹¦¨) Ãö©ó¦Û­qªí³æTextBox¿é¤JÃöÁä¦r¥X²{¸ê®Æ(ªþ½d¨Ò)

¦^´_ 10# GBKEE


    ¥¼©R¦W2.jpg

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-6-27 10:24 ½s¿è

¦n¹³´N¬O¥d¨ìUserForm1ªº¦a¤è

TOP

¦^´_ 12# av8d
ªþÀɬݬÝ

TOP

¦^´_ 13# GBKEE


    ¤j¤j~¥i¥H¤F~§Ú¬Ý¨ì³\¦h¤j¤j³£·|¨Ï¥ÎOption Explicit
Option Explicitªº·N¸q¬O¦bµ{¦¡¼Ò²Õ¤¤±j­¢¨C­Ó¦bµ{¦¡¼Ò²ÕùتºÅܼƳ£¥²¶·©ú½T§¹¾ãªº«Å§i©M©w¸q¨ä¦WºÙ,½d³ò»P«¬§O.
Option Explicit ³¯­z¦¡¥²¶·¥X²{¦b¼Ò²Õ¤¤©Ò¦³µ{§Ç¤§«e(§Y³Ì³»ºÝ)
·í Option Explicit ¦b¼Ò²Õ¤¤¨Ï¥Î®É¡A©Ò¦³ªºÅܼƥ²¶·¥H Dim¡A Private¡BPublic¡BReDim ©Î Static ³¯­z¦¡¨Ó©ú½T«Å§i¡C
¦b¼Ò²Õ¤¤¦pªG¨Ï¥ÎOption Explicit ,¦bµ{¦¡¤¤¦p¥¼«Å§iÅܼƪº¦WºÙ¡A«h¦b½sĶ¶¥¬q®É¡A·|µo¥Í¿ù»~¡C
¦pªG¨S¦³¨Ï¥Î Option Explicit ³¯­z¦¡¡A«h©Ò¦³¥¼«Å§iªºÅܼƳ£¬O Variant «¬ºA¡A°£«D¹w³]ªº«¬ºA¥t¥H Deftype ³¯­z¦¡©Ò«ü©w¹L¡C
Option Explicit ¥iÁקK¥´¿ùÅܼƦWºÙ©Î¦b¦³®Ä½d³ò¤º³]©w¨â­Ó¬Û¦PªºÅܼƦWºÙ¡C


³Ì¥D­n¬O¤£¬OÁקK¥´¿ùÅܼƦWºÙ~¦ý¬O³o¼Ë¨C¦¸³£¥²¶·¥ÎDim¡A Private¡BPublic¡BReDim ©Î Static ³¯­z¦¡¨Ó©ú½T«Å§i¡C
·N«ä¬O¤£¬O»¡
¦pªG§ÚÀH·N³]©w
a=textbox1
for i =1 to 3
a=a+1
next i

³o¼Ë¬O§_·|¥X²{¿ù»~~
§Úµo²{§Ú¤§«e©Ò°µªº³£¨S¥ÎOption Explicit~²{¦b­n¨Ó¤@­Ó¤@­Ó°£¿ù·|¤£·|ÁÙ¨Óªº«æ¶Ü?

TOP

¦^´_ 14# av8d
Option Explicit  ¥D­n¬O¥iÁקK¥´¿ùÅܼƦWºÙ ,¨Ï±oµ{¦¡¹B¦æ¤¤,§ä¤£¥X¿ù»~¦b­þ¸Ì
Textbox  ¬Oªí³æ¤º±±¨î¶µªºÃöÁä¦r, ­nÁקK©l¥Î .

TOP

¦^´_ 8# GBKEE


    ª©¥D¤j¤j±z¦n¡G

ÁÂÁ±zªº»¡©ú
¤p§Ì¤w²z¸Ñname
¦b¦¹ªº¥Î·N
Sub aa()
   
    Dim mSht As Worksheet
    Dim mRng As Range, E As Range
    Set mSht = Worksheets(1)
    With mSht
        Set mRng = .Range("a1:c5")
            mRng.Name = "NewName"
            [newname].Select
        For Each E In [newname]
            MsgBox E.Address
        Next
        
    End With
End Sub


·P®¦¤j¤j¡I

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-7-4 14:10 ½s¿è

¦^´_ 6# register313

Private Sub UserForm_Initialize()

    Dim d As Object, A

    Set d = CreateObject("Scripting.Dictionary")

    With ActiveSheet

        For Each A In .Range("d2", .[d2].End(xlDown))

          d(A.Value) = ""

        Next A

        ComboBox1.List = Application.Transpose(d.keys)

        d.RemoveAll

        For Each A In .Range("e2", .[e2].End(xlDown))

          d(A.Value) = ""

        Next A

        ComboBox2.List = Application.Transpose(d.keys)

    End With

End Sub
---------------------------------------------------------------------
ComboBox1 = DÄæ
ComboBox2 = EÄæ

­YD1=¦­À\  D2=¤ÈÀ\  D3=¦­À\
­YE1=½Þ¦×  E2=Âû¦×  E3=¤û¦×

·íComboBox1¿ï¨ì¦­À\ªº®É­Ô¡AComboBox2¬O§_¯à¥uÅã¥Ü½Þ¦×©M¤û¦×¡A¦]¬°Âû¦×¬O¤ÈÀ\ªº©Ò¥H¹LÂo¸Óµ§¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-6-28 17:48 ½s¿è

¦^´_ 17# av8d
  1. Option Explicit
  2. Dim d As Object
  3. Private Sub UserForm_Initialize()
  4.     Dim A As Range
  5.     Set d = CreateObject("Scripting.Dictionary")
  6.     With ActiveSheet
  7.         For Each A In .Range("d2", .[d2].End(xlDown))
  8.           d(A.Value) = IIf(d(A.Value) = "", A.Offset(, 1).Value, d(A.Value) & "," & A.Offset(, 1))
  9.         Next
  10.         ComboBox1.List = d.KEYS
  11.     End With
  12. End Sub
  13. Private Sub ComboBox1_Change()
  14.     If ComboBox1.ListIndex > -1 Then
  15.         ComboBox2.List = Split(d(ComboBox1.Value), ",")
  16.         ComboBox2.Value = ComboBox2.List(0)
  17.     End If
  18. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-6-28 21:06 ½s¿è

¦^´_ 18# GBKEE


°ÝÃD¸Ñ¨M~ÁÂÁÂ!

TOP

¦^´_ 19# av8d
Dim d As Object ³oµ{¦¡½X §A©ñ¦b­þ¸Ì   
¦pªG¦p¤U«Å§i¨â¦¸
  1. Dim d As Object  '1 ¼Ò²Õ ªº³»ºÝ «Å§iÅܼƠ ¬°¦¹¼Ò²Õªº¨p¥ÎÅܼƠ ¦¹¼Ò²Õ¤¤µ{§Ç¬Ò¥i¥ÎªºÅܼÆ
  2. Private Sub UserForm_Initialize()
  3.     Dim d As Object    '2 ¦bµ{§Ç¤¤ «Å§iÅܼƠ   '*** ³o¸Ì¤£­n«Å§i¤F
  4.    Set d = CreateObject("Scripting.Dictionary")  
  5. '³od ¬O   UserForm_Initialize µ{§Çªº  ¨Ã¤£¬O ¼Ò²Õ³»ºÝªºd
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD