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

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

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

½Ð°Ý¦U¦ì¥ý¶i
§Ú¤U¦Cµ{¦¡½X¦³­þ¸Ì¿ù»~¶Ü?
¬°¦ó§Ú¿é¤J²M³æ¥H¥~ªº¤å¦r
µLªk¥X²{¿ù»~°T®§

With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="=" & bb
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With

¦^´_ 15# GBKEE


    ·PÁÂG¤j¸Ô²Óªº¸ÑÄÀ
À°¤F§Ú«Ü¤jªº¦£
§A¯u¬O¦n¤H
:D

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

¦^´_ 13# GBKEE


    ·PÁÂG¤jªº¸Ñµª
§Ú¤Sµo²{¤@­Ó°ÝÃD
´N¬O°}¦C¦r¤¸¤Ó¦h¨S¿ìªk¥þ³¡¶ë¤J²M³æ¤º
xlBetween, Formula1:=bb
¦³¤èªk¸Ñ¨M£v?

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

¥»©«³Ì«á¥Ñ dafa ©ó 2012-1-17 08:29 ½s¿è

¦^´_ 11# GBKEE

«Ü©êºp»¡ªº¤£²M·¡
§Ú´ú¸ÕAccount CodeÄæ¦ì¿é¤J¿ù»~¸ê®Æ®É
¬°¦ó¥X²{ĵ§i°T®§®É¨S¦³¥X²{§Ú¿é¤Jªº¦r¦ê  
.ErrorMessage = "You must enter a number from five to ten"


ªþ¥ó¤w¤W¶Ç

2012-¦U·~°È­t³d¤H¥I´Ú©ú²Ó1.zip (388.96 KB)

TOP

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

TOP

¦^´_ 8# GBKEE


    ¦A½Ð°ÝG¤j¤@¤U
¬°¦ó§ÚªºÄµ§i°T®§¤£·|¥X²{


Sub ²M³æ©ú²Ó()

Dim bb, kk(30), aa
If ActiveCell.Cells.Column <> "4" Then Exit Sub

aa = ActiveCell
If aa = "Account Code " Then Exit Sub
If aa = "" Then Exit Sub
g = Worksheets("²M³æ©ú²Ó").Cells(65536, 2).End(xlUp).Row
For i = 1 To g
e = Worksheets("²M³æ©ú²Ó").Cells(i, 2)
If Worksheets("²M³æ©ú²Ó").Cells(i, 2) = aa Then

b = 0
j = Worksheets("²M³æ©ú²Ó").Cells(i, 34).End(xlToLeft).Column
    For a = 3 To j
        kk(b) = Worksheets("²M³æ©ú²Ó").Cells(i, a)
        b = b + 1
    Next a
bb = Join(kk, ",")
Exit For

End If
Next i
pp = Worksheets("²M³æ©ú²Ó").Cells(i, 3)
MsgBox pp, , "Account_Code»¡©ú"

ActiveCell.Cells(, 4).Select
ActiveCell = ""
With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:=bb
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = "You must enter a number from five to ten"
        .ShowInput = True
        .ShowError = True
    End With
Set kk(30) = Nothing
ActiveCell.Offset(, -5) = Date
ActiveCell.Offset(, 1) = Environ("UserName")
End Sub

TOP

¦^´_ 8# GBKEE


    ·PÁÂG¤jªº¼ö¤ß
À°§Ú¸Ñ¨MÃøÃD

TOP

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

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD