#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:16 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:54 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
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 Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"