我在这里制作的代码上周正在运行,现在由于某种原因,我收到一条错误消息:编译错误:参数不是可选的。
Sub BOLT ()
'Roi names repeated
ActiveSheet.Range("A1").Select
'make loop
Cells.Find(What:="ROI name", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select
Sheets("ISA_SourceData_1").Cells(nmbR + 1, 2).Value = "ROI name"
Do Until ActiveCell.Offset(0, 1).Range = nmbC + 1
Do Until ActiveCell.Offset(0, 1).Value = ""
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(0, 1).Select
ActiveCell.Offset(0, 1).Select
Selection.Copy
ActiveCell.Offset(0, -1).Select
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Select
ActiveSheet.Paste
ActiveCell.Offset(0, 3).Select
Loop
Cells.FindNext(After:=ActiveCell).Activate
ActiveCell.Offset(0, 1).Select
Loop
Sheets("ISA_SourceData_1").Cells(nmbR + 1, 2).Value = ""
End Sub