View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GEdwards GEdwards is offline
external usenet poster
 
Posts: 40
Default Need Syntax for "AND" to Evaluate 2 Cells

Dave,
Thanks for the info to NOT check the sheet name.

"ozgrid.com" wrote:

No need to check the Sheet name as the code resides Sheet Module;

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("I3") < "" And Range("K4") = "" Then
Range("K4") = Range("K3")
End If
End Sub

I also can helping thinking a simple IF Function in K4 will achieve the
same.



--
Regards
Dave Hawley
www.ozgrid.com
"GEdwards" wrote in message
...
I need to evaluate 2 cells while inside an "Private Sub
Worksheet_SelectionChange(ByVal Target As Range)". I thought AND would
work
but I cannot get it to work; I receive a syntax error on the AND(Range...
line.

Can someone please provide me the proper syntax to evaluate the 2 cells?

Here's my code...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveSheet.Name = "Sheet1" Then
And(Range("I3") < "", Range("K4") = "") Then
Range("K4") = Range("K3")
End If
End Sub