View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Robert[_30_] Robert[_30_] is offline
external usenet poster
 
Posts: 44
Default VBA Code for deleting rows with specific value

Can you also tell me how to refer to refer to another sheet (in which
the rows are located)? say for example "Sheet2" contains the data and
the command buttow will be put in "Sheet1"

Thanks again

Robert



Tom Ogilvy schreef:
Sub DeleteRows()
Dim rng as Range
set rng = columns(1).Find("EE")
if not rng is nothing then
do
rng.EntireRow.Delete
set rng = columns(1).Find("EE")
Loop while not rng is nothing
End if
End Sub

--
Regards,
Tom Ogilvy


"Robert" wrote:

Hi,

Can some one assist me with the following:
I want to create a macro that deletes all lines that contain a certain
value in column A.

For example
A
1 EE
2 EE
3 EE
4 EE
5 DD
6 DD
7 DD
8 DD
9 DD
10 DD

Does anyone knows which code to use for deleting all lines with "EE" om
column A?

All suggestions are mostly appreciated!

Thanks a lot

Regards,
Robert