我必须处理一个包含6个步骤的Excel。
但是,当我尝试执行步骤5时,却不断出现错误
“运行时错误'1004':应用程序定义的错误或对象定义的错误”
Sub CDN_S()
Dim dash As Range
Cells.Select
ActiveWindow.Split = False
Worksheets("sheet1").Range("C1").RemoveSubtotal
Range("E1048576").End(xlUp).Select
Selection.Resize(1, 13).Select
Range(Selection, "E1:Q1").Select
Selection.Replace What:="", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Set dash = Selection.Find(what:=("*-*"))
If Not dash Is Nothing Then
MsgBox ("minus found, check data!")
Stop
Else
MsgBox ("minus not found")
End If
Columns("R:R").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Delete Shift:=xlToLeft
Range("A1").End(xlDown).Offset(1).Resize _
(ActiveSheet.UsedRange.Rows.Count).EntireRow.Delete
MsgBox ("Completed")
End Sub
谢谢