View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Duncan[_5_] Duncan[_5_] is offline
external usenet poster
 
Posts: 290
Default IF Statement Help

This should be better:

Range("A3").Select
Myvalue = Selection.Value
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For Each cl In Range("A1:a" & lastrow)
MsgBox cl.Address
If cl.Value < Myvalue Then
cl.EntireRow.Select
End If
Next

Duncan

bodhisatvaofboogie wrote:
Range("A3").Select
MyValue = Selection
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set cell = Cells(a, "A")

If Not (cell = "Myvalue") Then
Selection.EntireRow.Select

End If

This statement Is just not working. Where am I going wrong? It is
supposed to do the following:

Select a specific cell -- Whatever that value is, set it to Myvalue. THEN
search through the column ("A:A") and if the cell is not equal to that
Myvalue, then select the entire row. Make sense?

THANKS FOR THE HELP!!!