View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shetty Shetty is offline
external usenet poster
 
Posts: 78
Default Need help with IF statement ! ! !

Thanks Dan =:)
The second code is exactly what I want to do. Because I failed with
this, I have tried to use set range etc which was also wrong. You have
explained nicely how and where I made mistakes which lead me to new
hights in VBA.
You help is very much appreciated.
Thanks again.
Regards,
Shetty.




"Dan E" wrote in message ...
CODE SHOULD BE:

Dim master As Range
Dim ind As Range
Set master = Range("B18")
Set ind = Range("C18")

If master.Value = ind.Value Then
MsgBox "Sagregation is OKEY"
Else: MsgBox "Please check the details again. There is an error"
End If

End Sub

AND

If Range("B18").Value = Range("C18").Value Then
MsgBox "Segregation is OK"
Else: MsgBox "Please check the details again, there is an error"
End If

Got the B's and C's a little mixed up...

Dan E