0
第一篇文章,赞赏格式反馈。我想用一个用户窗体向表格中的单元格添加一个值。组合框值'过滤器'栏1,文本框1值'过滤器栏2和生成的栏3是我的值从textbox2输入的目标单元格。通过用户表单VBA筛选表格和插入值
下面的代码显示编译错误:未定义子功能或功能(突出显示“Where”)。
Private Sub CommandButton1_Click()
Dim tbl As ListObject
Sheets("Sheet5").Activate
Set tbl = ActiveSheet.ListObject("Table1")
With tbl.DataBodyRange.Cells(12, tbl.ListColumns("Cost").Index)
.Value = TebxtBox2
Where tbl.DataBodyRange.Cells(0, tbl.ListColumns("Friendly Name").Index) = ComboBox.Value _
And tbl.DataBodyRange.Cells(11, tbl.ListColumns("Height").Index) = TextBox1.Value
End With
End Sub
感谢.....
请添加编译错误的详细信息,并尝试将其缩减为最小的示例:http://stackoverflow.com/help/mcve –