- ©«¤l
- 703
- ¥DÃD
- 276
- ºëµØ
- 0
- ¿n¤À
- 1005
- ÂI¦W
- 1
- §@·~¨t²Î
- Windows 10
- ³nÅ骩¥»
- Office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-6-30
- ³Ì«áµn¿ý
- 2024-5-29
|
¦p¦ó§ï¼g
- Public ckCurr As Boolean
- Private Sub XXXXComboBox1_Change() ' stillfish00 ´£¨Ñ
- If ckCurr Then Exit Sub
-
- Application.EnableEvents = False
-
- ckCurr = False
- ComboBox1.Visible = False
- Range(ComboBox1.LinkedCell).Offset(, 2).Select
- Application.EnableEvents = True
- End Sub
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim StrVdFml As String
-
- ' If ckCurr Then Exit Sub
- On Error Resume Next
- StrVdFml = Replace(ActiveCell.Validation.Formula1, "=", "")
- ' ActiveCell.Validation.Formula1 ¡G "=¤u§@ªí1!$A$3:$A$20"
- ' ComboBox1.ListFillRange ¡G ¤u§@ªí1!$A$3:$A$20
- ' Replace(ActiveCell.Validation.Formula1, "=", "") : "¤u§@ªí1!$A$3:$A$20"
- ' StrVdFml : "¤u§@ªí1!$A$3:$A$20"
- ActiveCell.Validation.InCellDropdown = False
- On Error GoTo 0
- If StrVdFml = "" Then
- If Me.ComboBox1.Visible Then Me.ComboBox1.Visible = False
- Else
- With Me.ComboBox1
- ' ComboBox1.progID =EMBED("Forms.ComboBox.1","")
- ' ComboBox1¡G ComboBox
- ' LinkedCell¡G $A$2
- ' ListFillRange ¡G ¤u§@ªí1!$A$3:$A$20
- .Left = ActiveCell.Left
- .Top = ActiveCell.Top
- ' .Width = ActiveCell.Width + 140
- .Width = ActiveCell.Width + 80
- ' .Height = ActiveCell.Height + 10
- .Height = ActiveCell.Height + 5
- ' .Font.Size = 22
- .Font.Size = 16
- .LinkedCell = ActiveCell.Address ' "$A$2"
- .ListFillRange = StrVdFml ' "¤u§@ªí1!$A$3:$A$20"
- .Visible = 1 ' Åã¥Ü¤U©Ô²Å¸¹
- .Object.SpecialEffect = 3
- '.Object.Font.Size = ActiveCell.Font.Size
- End With
- End If
-
- ckCurr = False
- End Sub
- Sub CellValidation() ' stillfish00 ´£¨Ñ
- With Sheets("¤u§@ªí1").[B2:B200].Validation
- .Delete
- .Add Type:=xlValidateList, Formula1:="=¤u§@ªí2!$C$2:$C$200"
- End With
- 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¸ê®Æ |
|