Thread: deletion macro
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
steve steve is offline
external usenet poster
 
Posts: 576
Default deletion macro

Thanks Ken! Got a bit rushed...

--
sb
"Ken Wright" wrote in message
...
Slight typo, you need the second set of Quotes on the ("A:A) bit, eg

("A:A").

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL2K & XLXP

--------------------------------------------------------------------------

--
Attitude - A little thing that makes a BIG difference
--------------------------------------------------------------------------

--



"steve" wrote in message

...
Bob,

Dim rng As Range, myval as Double
myval = Range("D1").Value
Set rng = Range("A:A).Find(myval)
If Not rng Is Nothing Then
Rows(rng.Row).EntireRow.Delete
Else
MsgBox ("not found")
End If

Try this out...
(original code "stolen" from this ng)
--
sb
"Bob" wrote in message
...
Hello All,

I need help with a simple macro to delete an entry and
then delete the row that contained that entry.

Column A contains numbers. I would like to enter a number
in say cell D1. If that number is in column A then delete
that number and the row.

Thanks for any help!
Bob P.