View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Macro if greater than letter then delete

This misses rows for me. Also errors on empty cells. (xl97 for that)

--
Regards,
Tom Ogilvy

"Don Guillett" wrote in message
...
try this for f,g & h or chg to f for only f

Sub deleteifbadgrade()
For Each c In range("f2:H" & cells(rows.count,"f").end(xlup).row)
If Asc(UCase(c)) 67 Then c.entirerow.delete
Next
End Sub


--
Don Guillett
SalesAid Software

"mike b" wrote in message
...
Don, sorry I'm getting confused. I am alos trying to learn how to

program
as
well.

What would be the macro code If I were to only look at column F for a

letter
D or E and then delete the whole entire row?

Thanks

"Don Guillett" wrote:

change to c.ENTIRErow.delete

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
try this

Sub deleteifbadgrade()
For Each c In Selection
If Asc(UCase(c)) 67 Then c.row.delete
Next
End Sub

--
Don Guillett
SalesAid Software

"mike b" wrote in message
...
Hello,

I need a macro that can look at columns F, G and H, if any of

those
columns
have a letters D-, D, D+ or E then delete the row.

Thanks for your help
--
Mike B