View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Excel Delete VB Macro

Ty,

Something along the lines of

If ActiveCell.Interior.Color = RGB(255, 0, 0) Then
If Cells(ActiveCell.Row,10).Value = "" Then
ActiveCell.EntireRow.Clear
End If
End If

Column J is 10....

HTH,
Bernie
MS Excel MVP


"Ty" wrote in message
...
On Jul 31, 9:30 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
In response to the stepping from the bottom up to the top. Is that
why the "-1" is in the "ActiveCell.Offset(Offsetcount - 1, 0)". It is
not stepping from the bottom up but it is just doing what I call a 2
step(2 cells only). I see this while I'm doing the F8 and Watch.
p.s.-- I haven't had time to try the deletion as of yet. I really
appreciate the sharing of knowledge from an expert.


No. The -1 is so that the code compares two adjacent cells.

HTH,
Bernie
MS Excel MVP


Perfect. It works. 2 more questions.

What if I just wanted to delete rows that have the cell blank?

my answer: ActiveCell.Interior.Color = RGB(255, 0, 0) need to change
the RGB to the empty cell numbers(0, 0, 0)

What if I had another column such as column J as a condition to not
delete with my initials like TB?

my answer: If ActiveCell.Interior.Color = RGB(255, 0, 0) + column J is
blank. Don't really have answer but I'm trying to figure this out on
my own.

Thanks for your help....