NorthbyNorthwest
Board Regular
- Joined
- Oct 27, 2013
- Messages
- 147
- Office Version
- 365
Hoping someone can help me with error problem. I am trying to copy a worksheet several timeswithin a workbook and assign new names to sheets. However, the procedure throws runtime error424 "object required" on line which reads: Sheets(3).CopyAfter:=Sheets(Sheets.Count). It thengoes on to copy and name sheets; however, the procedure ends. What can I do to prevent the error? I have subsequent code I’d like the procedureto run.
VBA Code:
With ThisWorkbook.Sheets(3)
.Visible = xlSheetVisible
.Activate
.Range("A7").Select
End With
Sheets(3).CopyAfter:=Sheets(Sheets.Count)
Set ws =ActiveSheet
ws.Name ="Alpha"
Sheets(3).CopyAfter:=Sheets(Sheets.Count)
Set ws =ActiveSheet
ws.Name ="Bravo"
Sheets(3).CopyAfter:=Sheets(Sheets.Count)
Set ws =ActiveSheet
ws.Name ="Charlie"
Sheets(3).CopyAfter:=Sheets(Sheets.Count)
Set ws =ActiveSheet
ws.Name ="Delta"
Last edited by a moderator: