Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Greetings!
This question is for Excel 2007. I am working with data sets that have many rows of data and I only need a few of them. What I would like to do is create a macro that will delete 100 rows from my worksheet, starting where I place the cursor. What is the best way to do this? Whenever I try to record the macro and use it I always wind up having the 100 rows being deleted from the same location, but I need to move down through the entire spreadsheet. greg |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can delete multiple rows with code like
ActiveCell.Resize(100, 1).EntireRow.Delete This code will delete entire rows starting with the active cell down to row number ActiveCell.Row + 99. -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "gak27" wrote in message ... Greetings! This question is for Excel 2007. I am working with data sets that have many rows of data and I only need a few of them. What I would like to do is create a macro that will delete 100 rows from my worksheet, starting where I place the cursor. What is the best way to do this? Whenever I try to record the macro and use it I always wind up having the 100 rows being deleted from the same location, but I need to move down through the entire spreadsheet. greg |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
maybe
Sub addhpb() ActiveCell.EntireRow.Select Set MyRange = Selection.Resize(100) MyRange.Delete End Sub Mike "gak27" wrote: Greetings! This question is for Excel 2007. I am working with data sets that have many rows of data and I only need a few of them. What I would like to do is create a macro that will delete 100 rows from my worksheet, starting where I place the cursor. What is the best way to do this? Whenever I try to record the macro and use it I always wind up having the 100 rows being deleted from the same location, but I need to move down through the entire spreadsheet. greg |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is a one-liner:
Sub ordinate() Range(ActiveCell, ActiveCell.Offset(99, 0)).EntireRow.Delete End Sub -- Gary''s Student - gsnu200762 "gak27" wrote: Greetings! This question is for Excel 2007. I am working with data sets that have many rows of data and I only need a few of them. What I would like to do is create a macro that will delete 100 rows from my worksheet, starting where I place the cursor. What is the best way to do this? Whenever I try to record the macro and use it I always wind up having the 100 rows being deleted from the same location, but I need to move down through the entire spreadsheet. greg |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks! I'll try all of the suggestions. Sorry for the multiple post of
this subject above... "gak27" wrote: Greetings! This question is for Excel 2007. I am working with data sets that have many rows of data and I only need a few of them. What I would like to do is create a macro that will delete 100 rows from my worksheet, starting where I place the cursor. What is the best way to do this? Whenever I try to record the macro and use it I always wind up having the 100 rows being deleted from the same location, but I need to move down through the entire spreadsheet. greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents | Excel Discussion (Misc queries) | |||
Macro to Delete Certain Rows | Excel Discussion (Misc queries) | |||
Create a macro to delete rows if value is less than a specified nu | Excel Worksheet Functions | |||
create macro - if cell is 0 delete row | Excel Worksheet Functions | |||
delete rows-macro | Excel Discussion (Misc queries) |