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 –