View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mpeplow[_11_] mpeplow[_11_] is offline
external usenet poster
 
Posts: 1
Default Simple Problem - Please Help


Can anyone tell me why this is not working?

This is suppose to check each row on the sheet and if C * E < 3000 the
delete that row. I've rewritten this sub many time but cannot get it t
work properly.

In advance. Many Thanks!!


Sub Filter_Two()
Dim valPrice As Currency
Dim valQTY As Variant


FinalRow = ActiveSheet.Range("A65536").End(xlUp).Row

For i = 2 To FinalRow
'If ActiveSheet.Range("A" & i).Text = "" Then Exit Sub

valQTY = ActiveSheet.Range("C" & i).Value
valPrice = ActiveSheet.Range("E" & i).Value


If valPrice * valQTY < 3000 Then
Rows(i).Activate
Rows(i).Select
Rows(i).Delete
FinalRow = FinalRow - 1
End If
Next i
End Su

--
mpeplo
-----------------------------------------------------------------------
mpeplow's Profile: http://www.excelforum.com/member.php...fo&userid=3481
View this thread: http://www.excelforum.com/showthread.php?threadid=56213