![]() |
Select Method of Sheets
I have a macro and I get the next error: "run-time error 1004 select method
of sheets class failed" I'm trying to do un array of sheets and then select copy and cut some row’s here is part of my code: z = Sheets("NovaUSA").Index 'to get the index for the first row to start y = Sheets("Beans (P)").Index ReDim SheetsGroup(z To y) For i = z To y SheetsGroup(i) = Sheets(i).Name Next i Sheets(SheetsGroup).Select ' here its where I get the error Columns("AG:AK").Select Range("AG6").Activate Application.CutCopyMode = False Selection.Delete Shift:=xlToLeft Could somebody help me |
Select Method of Sheets
Brenda,
I think you need a corresponding array index along with a for/next loop around your deletion code: For i = z To y Sheets(SheetsGroup(i)).Select ' here its where I get the error Columns("AG:AK").Select Range("AG6").Activate Application.CutCopyMode = False Selection.Delete Shift:=xlToLeft next i hth, Doug "Brenda Meza via OfficeKB.com" wrote in message ... I have a macro and I get the next error: "run-time error 1004 select method of sheets class failed" I'm trying to do un array of sheets and then select copy and cut some row's here is part of my code: z = Sheets("NovaUSA").Index 'to get the index for the first row to start y = Sheets("Beans (P)").Index ReDim SheetsGroup(z To y) For i = z To y SheetsGroup(i) = Sheets(i).Name Next i Sheets(SheetsGroup).Select ' here its where I get the error Columns("AG:AK").Select Range("AG6").Activate Application.CutCopyMode = False Selection.Delete Shift:=xlToLeft Could somebody help me |
Select Method of Sheets
|
All times are GMT +1. The time now is 06:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com