|
Sub 保存()
ThisWorkbook.Sheets("Sheet4").Activate
On Error GoTo 100
Dim es As Range, a%
If Sheet3.[g:g].Find([b4]) = Sheet4.[b4] Then
MsgBox "已经保存过了!"
Else
100:
Set es = Cells.Find("*", , xlFormulas, , , xlPrevious)
a = Application.CountA(Sheet3.[a:a])
If es.Row = 5 Then MsgBox "没有填写内容": End
Range([a6], es).Copy Sheet3.Cells(a + 1, 1)
Sheet3.Cells(a + 1, "g").Resize(es.Row - 5) = [b4]
Sheet3.Cells(a + 1, "h").Resize(es.Row - 5) = [f4]
MsgBox "保存成功"
End If
End Sub
我下面的两句代码好像不对,大师们能否指点一下?
If Sheet3.[g:g].Find([b4]) = Sheet4.[b4] Then
If es.Row = 5 Then MsgBox "没有填写内容": End
|
|