Macro to delete certain rows

Sunline

Well-known Member
Joined
Oct 6, 2007
Messages
701
Office Version
  1. 2016
Platform
  1. Windows
hello all , have looked thru these on here but alot seem more complicated than my request .

Is there a macro which will delete all rows greater than row 1 being headings and less than row 76,999 .

If there is also would there be one to delete rows between and counting row 13,999 and row 33,999 .
Thanks .
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Sunline,

Maybe if you explain a little bit more what you want to get and it would be fine if you show a sample to work with.

Do you want to clear contents in rows between rows x and y or eliminate rows between rows x and y?

In the 2nd question, do you want to count rows?

Regards.
 
Upvote 0
Hi , looking for 2 macros independent of each other , yes too delete total rows , leaving heading row 1 , so delete every row from row 2 too row 76,999 .

I dont want to do both in one go , i used these 2 examples so i could use them to suit and change rows numbers as needed .

And delete entire rows from row 13,999 and too row 33,999 .
Thanks ,
 
Upvote 0
You don't mean something like this, do you?

Code:
Sub DeleteLotsOfRowsA()
Rows("2:76998").Delete Shift:=xlUp
End Sub

Code:
Sub DeleteLotsOfRowsB()
Rows("14000:33998").Delete Shift:=xlUp
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top