Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default Row Deletion

I am trying to create a macro that looks at all the data
from row 26 down and using data in column D if it does not
equal DR* or DB* delete the row.

End result all rows below 26 are deleted leaving DR* and
DB*.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Row Deletion

it is possible with a automatic filter !!!
filter with db*



--
....Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel


"Dan" a écrit dans le message de
...
I am trying to create a macro that looks at all the data
from row 26 down and using data in column D if it does not
equal DR* or DB* delete the row.

End result all rows below 26 are deleted leaving DR* and
DB*.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Row Deletion

Hi Dan;

You can use the following;


Sub try()
'selects the first cell you want to look at
Range("A27").Select

'loop through the rows until it hits an empty cell
While Not ActiveCell = ""

If Not ActiveCell.Offset(0, 3) = "DR*" And _
Not ActiveCell.Offset(0, 3) = "DB*" Then
'if its is not one of the two desired
'values then delete the row
Application.DisplayAlerts = False
ActiveCell.EntireRow.Delete
End If
ActiveCell.Offset(1, 0).Select
Wend

End Sub


-----Original Message-----
I am trying to create a macro that looks at all the data
from row 26 down and using data in column D if it does

not
equal DR* or DB* delete the row.

End result all rows below 26 are deleted leaving DR* and
DB*.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Row Deletion

something like this from the bottom up. I did not test but you get the idea
for i = cells(rows.count,"d").end(xlup).row to 26 step -1
if cells(i,"d")< "DR*" and cells(i,"d")<"DB*" then
cells(i,"d").entirerow.delete
next
--
Don Guillett
SalesAid Software

"Dan" wrote in message
...
I am trying to create a macro that looks at all the data
from row 26 down and using data in column D if it does not
equal DR* or DB* delete the row.

End result all rows below 26 are deleted leaving DR* and
DB*.




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
#Ref! after row deletion Rick Excel Discussion (Misc queries) 3 March 19th 10 04:39 PM
Macro deletion Patricia D[_2_] Excel Discussion (Misc queries) 1 July 19th 09 04:58 AM
name deletion rk0909 Excel Discussion (Misc queries) 2 January 4th 08 11:03 PM
On deletion of rows Stephen Howe Excel Discussion (Misc queries) 2 October 7th 05 06:02 PM
#REF! after cell deletion Colin G Eastwood Excel Discussion (Misc queries) 1 December 2nd 04 01:22 PM


All times are GMT +1. The time now is 08:52 PM.

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"