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

¦p¦ó§ï¼g

¦p¦ó§ï¼g

  1. Public ckCurr As Boolean

  2. Private Sub XXXXComboBox1_Change()    '  stillfish00 ´£¨Ñ
  3.     If ckCurr Then Exit Sub
  4.    
  5.     Application.EnableEvents = False
  6.    
  7.     ckCurr = False
  8.     ComboBox1.Visible = False
  9.     Range(ComboBox1.LinkedCell).Offset(, 2).Select
  10.     Application.EnableEvents = True
  11. End Sub

  12. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  13.     Dim StrVdFml As String
  14.    
  15.     '  If ckCurr Then Exit Sub
  16.     On Error Resume Next
  17.         StrVdFml = Replace(ActiveCell.Validation.Formula1, "=", "")
  18.         '  ActiveCell.Validation.Formula1 ¡G  "=¤u§@ªí1!$A$3:$A$20"
  19.         '  ComboBox1.ListFillRange        ¡G   ¤u§@ªí1!$A$3:$A$20
  20.         '  Replace(ActiveCell.Validation.Formula1, "=", "") : "¤u§@ªí1!$A$3:$A$20"
  21.         '  StrVdFml : "¤u§@ªí1!$A$3:$A$20"
  22.         ActiveCell.Validation.InCellDropdown = False
  23.     On Error GoTo 0
  24.     If StrVdFml = "" Then
  25.         If Me.ComboBox1.Visible Then Me.ComboBox1.Visible = False
  26.     Else
  27.         With Me.ComboBox1
  28.             '  ComboBox1.progID   =EMBED("Forms.ComboBox.1","")
  29.             '  ComboBox1¡G        ComboBox
  30.             '  LinkedCell¡G       $A$2
  31.             '  ListFillRange ¡G   ¤u§@ªí1!$A$3:$A$20
  32.             .Left = ActiveCell.Left
  33.             .Top = ActiveCell.Top
  34.             '  .Width = ActiveCell.Width + 140
  35.             .Width = ActiveCell.Width + 80
  36.             '  .Height = ActiveCell.Height + 10
  37.             .Height = ActiveCell.Height + 5
  38.             '  .Font.Size = 22
  39.             .Font.Size = 16

  40.             .LinkedCell = ActiveCell.Address    '  "$A$2"
  41.             .ListFillRange = StrVdFml           '  "¤u§@ªí1!$A$3:$A$20"
  42.             .Visible = 1                        '  Åã¥Ü¤U©Ô²Å¸¹

  43.             .Object.SpecialEffect = 3
  44.             '.Object.Font.Size = ActiveCell.Font.Size
  45.         End With
  46.     End If
  47.   
  48.     ckCurr = False
  49. End Sub

  50. Sub CellValidation()      '  stillfish00 ´£¨Ñ
  51.     With Sheets("¤u§@ªí1").[B2:B200].Validation
  52.         .Delete
  53.         .Add Type:=xlValidateList, Formula1:="=¤u§@ªí2!$C$2:$C$200"
  54.     End With
  55. End Sub
½Æ»s¥N½X
­ì¥\¯à:
ÂI¤u§@ªí1ªºB2®É¡A·|Åã¥Ü¤u§@ªí2ªºB2:B200ªº¸ê®Æ

§ï¦¨:
ÂI¤u§@ªí1ªºC2®É¡A·|Åã¥Ü¤u§@ªí2ªºC2:C200ªº¸ê®Æ

©Ò¥H§Ú±NB2:B200³o¬q§ï¦¨C2:C200~§ó§ï¥¢±Ñ~µL¸ê®Æ

¦^´_ 1# av8d
2003ª©¤¤ ·s¼WÅçÃÒ¤½¦¡ ª½±µ°Ñ·Ó¨ì¥»¨­¤§¥~ªº¤u§@ªí,·|¦³¿ù»~
  1. Sub CellValidation()
  2.    Sheets("SHEET2").Range("C2:C200").Name = "XX"
  3.    With Sheets(1).[B2:B200].Validation    '¥i§ï¦¨ [C2:C200]
  4.             .Delete
  5.             .Add Type:=xlValidateList, Formula1:="=XX"    '=SHEET2!$C$2:$C$200"
  6.    End With
  7. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD