Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Exits
With ComboBox1
.ListFillRange = "Project!B5:C" & Sheet2.Cells(1, 6) - 1
If .Visible Then .Visible = False
If (((Target.Cells.Column = 3) Or (Target.Cells.Column = 4)) And Target.Cells.row > 7 And Target.Cells.row <= 39) Then
If Target.Cells.Column = 3 Then
.LinkedCell = "C" & Target.row
.ListFillRange = "Project!B5:C" & Sheet2.Cells(1, 6) - 1
Else
'.LinkedCell = "D" & Target.row
'.ListFillRange = "WBS!C5:D" & Sheet1.Cells(1, 6) - 1
.List = WBS!c5: c5.Value
End If
.AutoLoad = True
.Top = Target.Top
.Left = Target.Left + Target.Width - .Width
.Height = Target.Height + 1
If Not .Visible Then .Visible = True
Else
If .Visible Then .Visible = False
End If
End With
Exits:
End Sub我写了如上一段代码,我调试过."WBS!C5:D" & Sheet1.Cells(1, 6) - 1和"Project!B5:C" &
Sheet2.Cells(1, 6) - 1 里是有数据的..但为什么下拉选项里就是没有数据截入到里面去呢??各位大哥..帮帮小弟!
On Error GoTo Exits
With ComboBox1
.ListFillRange = "Project!B5:C" & Sheet2.Cells(1, 6) - 1
If .Visible Then .Visible = False
If (((Target.Cells.Column = 3) Or (Target.Cells.Column = 4)) And Target.Cells.row > 7 And Target.Cells.row <= 39) Then
If Target.Cells.Column = 3 Then
.LinkedCell = "C" & Target.row
.ListFillRange = "Project!B5:C" & Sheet2.Cells(1, 6) - 1
Else
'.LinkedCell = "D" & Target.row
'.ListFillRange = "WBS!C5:D" & Sheet1.Cells(1, 6) - 1
.List = WBS!c5: c5.Value
End If
.AutoLoad = True
.Top = Target.Top
.Left = Target.Left + Target.Width - .Width
.Height = Target.Height + 1
If Not .Visible Then .Visible = True
Else
If .Visible Then .Visible = False
End If
End With
Exits:
End Sub我写了如上一段代码,我调试过."WBS!C5:D" & Sheet1.Cells(1, 6) - 1和"Project!B5:C" &
Sheet2.Cells(1, 6) - 1 里是有数据的..但为什么下拉选项里就是没有数据截入到里面去呢??各位大哥..帮帮小弟!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货