|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub chaozhao()
Dim sH As Worksheet, rg As Range, sg As Range
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set sH = Worksheets("生产日报") '从”生产日报“中读
With sH
Set rg = .Range("A:A").Find("7-11D", , xlValues, xlPart)
End With
Worksheets("准备车间").Activate
Set sH = Worksheets("准备车间")
With sH
Set sg = .Range("F:F").Find("7/11", lookat:=xlWhole)
If Not sg Is Nothing Then
Sheets("准备车间").Cells(sg.Row, "M") = Sheets("生产日报").Cells(rg.Row, "M")‘
End If
End With
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
在这句话中,把 Sheets("准备车间").Cells(sg.Row, "M") = Sheets("生产日报").Cells(rg.Row, "M")‘ 中的 cells(rg.row,"m")改为cells(rg.row+3,"M"),程序就报错了,怎么回事,请教。
|
|