【发布时间】:2018-07-16 21:47:39
【问题描述】:
我在将我创建的 excel 用户表单中的复选框信息返回到 excel 中的数据库时遇到问题。它一直在我的 Excel 工作簿中放置活动工作表而不是工作表 2。
Sub CheckBox2_Click()
Dim iRow As Long
iRow = Range("A" & Rows.Count).End(xlUp).Offset(1).Row
If CheckBox2 Then
Range("G" & iRow) = "Received"
Else
Range("G" & iRow).ClearContents
End If
End Sub
我在想我需要设置以下以使其工作,但它没有帮助。
iRow = Application.Workbooks("PIDParcelUtilities.xlsm").Worksheets("PIDParcelUtilitiesData").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
【问题讨论】:
-
Private Sub cmdAdd_Click() Dim iRow 只要 Dim ws 作为工作表集 ws = Worksheets("PIDParcelUtilitiesData")