Delete Row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Sub Macro22()
Dim iRow as long
iRow = Range("Row").Value
Rows(Row).Delete
End Sub

HTH
 
Superb - Worked a treat
Many thanks

Chip Pearson said:
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
 

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