Delete Rows Error Message

  • Thread starter Thread starter matt_st_onge
  • Start date Start date
M

matt_st_onge

The following string...

Sheets("Group Lists").Select
Rows("10401:13000").Select
Selection.Delete Shift:=xlUp
Sheets("Index").Select

....is returning the following error message...

"Run-time error '1004':

Select method of Range class failed"

Is there a limit as to how many rows Excel will select? Reason I ask
is...I do this exact string on a blank sheet and it works fine.

Any help would be greatly appreciated.

Kind Regards,

Matt St.Onge
Drafting & Estimating Manager
Mankato Kasota Stone
www.mankatokasotastone.com
 
try this

Sheets("Group Lists").Rows("10401:13000").Delete Shift:=xlUp
Sheets("index").Select
 
Try
Sheets("Group Lists").Range("10401:13000").EntireRow.Delete Shift:=xlUp
Sheets("Index").Select
 
The code can be cleaned up if you want like this

Sheets("Group Lists").Rows("10401:13000").Delete Shift:=xlUp
Sheets("Index").Select

There will be a problem if the sheet is protected. Selects are rarely
required and can cause difficulty. Let me know how it goes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top