Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Row
Hi,
I am looking for a way to delete a row depending on a number in a range. For example, if 124 was in the range, I would then want to delete row 124. My Poor attempt: Sub Macro22() Row = Range("Row").Value Rows(" & Row & ").Select Selection.Delete End Sub Any help greatly appreciated Regards John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Row
Try
Rows(Range("TheRow").Value).Delete where TheRow is the name of the cell containing the row number to delete. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "JohnUK" wrote in message ... Hi, I am looking for a way to delete a row depending on a number in a range. For example, if 124 was in the range, I would then want to delete row 124. My Poor attempt: Sub Macro22() Row = Range("Row").Value Rows(" & Row & ").Select Selection.Delete End Sub Any help greatly appreciated Regards John |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Row
Sub Macro22()
Dim iRow as long iRow = Range("Row").Value Rows(Row).Delete End Sub HTH -- AP "JohnUK" a écrit dans le message de news: ... Hi, I am looking for a way to delete a row depending on a number in a range. For example, if 124 was in the range, I would then want to delete row 124. My Poor attempt: Sub Macro22() Row = Range("Row").Value Rows(" & Row & ").Select Selection.Delete End Sub Any help greatly appreciated Regards John |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Row
Superb - Worked a treat
Many thanks "Chip Pearson" wrote: Try Rows(Range("TheRow").Value).Delete where TheRow is the name of the cell containing the row number to delete. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "JohnUK" wrote in message ... Hi, I am looking for a way to delete a row depending on a number in a range. For example, if 124 was in the range, I would then want to delete row 124. My Poor attempt: Sub Macro22() Row = Range("Row").Value Rows(" & Row & ").Select Selection.Delete End Sub Any help greatly appreciated Regards John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |