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

¤@­Ó²M³æÅçÃÒ°ÝÃD

¦^´_ 1# dafa
  1. Sub Ex()
  2.    Dim BB(3), CC
  3.    BB(0) = 1
  4.    BB(1) = 3
  5.    BB(2) = 4
  6.    BB(3) = 5
  7.    'CC = Join(BB, ",")          '°}¦C
  8.    CC = "=" & [A1:A5].Address   'Àx¦s®æ
  9.    With Selection.Validation
  10.         .Delete
  11.         .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
  12.         xlBetween, Formula1:=CC
  13.         .IgnoreBlank = True
  14.         .InCellDropdown = True
  15.         .InputTitle = ""
  16.         .ErrorTitle = ""
  17.         .InputMessage = ""
  18.         .ErrorMessage = ""
  19.         .ShowInput = True
  20.         .ShowError = True
  21.     End With
  22. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# dafa
  1. Option Explicit
  2. Sub Ex()
  3.     Dim BB(5 To 30), i As Integer
  4.     For i = 5 To 30
  5.         BB(i) = i + 2
  6.     Next
  7.     MsgBox Join(BB, ",")
  8. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# dafa
xlBetween, Formula1:="=" & bb §ï¦¨  xlBetween, Formula1:=bb

TOP

¦^´_ 10# dafa
¬°¦ó§ÚªºÄµ§i°T®§¤£·|¥X²{
¨S¬Ý¨ìÀɮקڤ]¤£ª¾¹D

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-1-17 10:07 ½s¿è

¦^´_ 12# dafa    
Set A= ActiveCell                                                 '½Ð¥[¤W      
   ActiveCell.Cells(, 4).Select      ->Selection
   ActiveCell = ""
   With Selection.Validation                   'Selection->  ÅçÃÒ ¬O¦b ActiveCell.Cells(, 4)  ¤£¬O ­ì¥ýªº ActiveCell
§ï¦¨  With A.Validation

TOP

¦^´_ 14# dafa
°}¦C¦r¤¸¤Ó¦h¨S¿ìªk¥þ³¡¶ë¤J²M³æ¤º
  1. Sub ²M³æ©ú²Ó()
  2.     Dim bb, kk(), aa, B As Integer, Rng As Range
  3.             'kk() °ÊºA°}¦C ¥i¨Ì»Ý¨D«ü©w¤¸¯Àªº¼Æ¶q , kk(30) :¦³31­Ó¤¸¯À (0 To 30 )
  4.     If ActiveCell.Cells.Column <> "4" Then Exit Sub
  5.     aa = ActiveCell
  6.     If aa = "Account Code " Then Exit Sub
  7.     If aa = "" Then Exit Sub
  8.     g = Worksheets("²M³æ©ú²Ó").Cells(65536, 2).End(xlUp).Row
  9.     B = 0    '°ÊºA°}¦Cªº¼Æ¥Ø: ¦¹®É  °ÊºA°}¦C©|¥¼«ü©w¤¸¯À¼Æ¥Ø
  10.     For i = 1 To g
  11.         e = Worksheets("²M³æ©ú²Ó").Cells(i, 2)
  12.         If Worksheets("²M³æ©ú²Ó").Cells(i, 2) = aa Then
  13.             j = Worksheets("²M³æ©ú²Ó").Cells(i, 34).End(xlToLeft).Column
  14.             For a = 3 To j
  15.                 ReDim Preserve kk(B)     'ReDim ³¯­z¦¡ ¦bµ{§Ç¼h¦¸¤¤¥Î¨Ó­«·s°t¸m°ÊºA°}¦CÅܼƪºÀx¦sªÅ¶¡¡C
  16.                 'Preserve ¿ï¾Ü©Ê¤Þ¼Æ¡C·í§ïÅܭ즳°}¦C³Ì«á¤@ºûªº¤j¤p®É¡A¤´µM«O¦³­ì¨Óªº¸ê®ÆªºÃöÁä¦r¡C
  17.                 kk(B) = Worksheets("²M³æ©ú²Ó").Cells(i, a)
  18.                 B = B + 1
  19.             Next a
  20.             bb = Join(kk, ",")
  21.             Exit For
  22.         End If
  23.     Next i
  24.     pp = Worksheets("²M³æ©ú²Ó").Cells(i, 3)
  25.     MsgBox pp, , "Account_Code»¡©ú"
  26.     Set Rng = activecells
  27.     ActiveCell.Cells(, 4).Select
  28.     ActiveCell = ""
  29.     With Rng.Validation
  30.         .Delete
  31.         .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
  32.         xlBetween, Formula1:=bb
  33.         .IgnoreBlank = True
  34.         .InCellDropdown = True
  35.         .InputTitle = ""
  36.         .ErrorTitle = ""
  37.         .InputMessage = ""
  38.         .ErrorMessage = "You must enter a number from five to ten"
  39.         .ShowInput = True
  40.         .ShowError = True
  41.     End With
  42. 'Set kk = Nothing          'kk ¬O°}¦C  ¤£¬Oª«¥ó
  43. ActiveCell.Offset(, -5) = Date
  44. ActiveCell.Offset(, 1) = Environ("UserName")
  45. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD