Thread: Delete Rows
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JohnUK JohnUK is offline
external usenet poster
 
Posts: 173
Default Delete Rows

Sorry Norman its me, not explaining very well.
If say I dont use a Range:
If I entered a name into Cell A1 (Any name) I then want all the rows that
have that name in column G Deleted.
I see you have worked very hard at the code and appreciate what you have
done and would fully understand if you gave up on me
John


"Norman Jones" wrote:

Hi John,

The suggested code only looks at the Names range and it only deletes rows
whose column G value is Fred. Rows which do not satify these two
requirements will not be deleted.

If, however, your intention is to delete the content of such rows, rather
than deleting the rows themselves, try changing the line:

delRng.EntireRow.Delete


to

delRng.EntireRow.ClearContents

And if your intention is only to delete the contents of that part of the row
which intersects with the Names range, then change the above line to:

Intersect(delRng.EntireRow, SH.Range("Names")).ClearContents



---
Regards,
Norman


"JohnUK" wrote in message
...
Hi Norman,
Thanks for your help.
I ran your code and instead of deleting the rows with the name I entered
into the range, it deleted the range instead.
Did I do something wrong
John