|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
你好,楼主, 今天打开文件输入数据添加时出现错误信息
方法“Range”作用于对象“_Worksheet”失效
然后点击调试出现下列信息, 第一行是黄色的, 请问如何修改
.Range("$B$" & LastRow).Value = WorksheetFunction.Max(.Range("B:B")) + 1
.Range("$C$" & LastRow).Value = Format(Add_Records_Form.Date_input.Value, "yyyy-mm-dd")
.Range("$D$" & LastRow).Value = Add_Records_Form.Account_input.Value
.Range("$E$" & LastRow).Value = Add_Records_Form.Categ_input.Value
.Range("$F$" & LastRow).Value = WorksheetFunction.VLookup(Add_Records_Form.Account_input.Value, EHF_03AccStg.Range("B:F"), 4, 0)
If Add_Records_Form.OP_Credit Then .Range("$G$" & LastRow).Value = Add_Records_Form.Amount_input.Value
If Add_Records_Form.OP_Debit Then .Range("$H$" & LastRow).Value = Add_Records_Form.Amount_input.Value
If Trim(Add_Records_Form.Owner_input.Value) = "" Then
.Range("$I$" & LastRow).Value = " "
Else
.Range("$I$" & LastRow).Value = Add_Records_Form.Owner_input.Value
End If
If Trim(Add_Records_Form.Descrp_input.Value) = "" Then
.Range("$J$" & LastRow).Value = " "
Else |
|