if coloumn B and coloumn C are equal to each other then in coloumn A put True or False if equal then True and if not equal then false by vba

what I want is if coloumn B and coloumn C  are equal to each other then in coloumn A put True or False  if equal then True and if not equal then false by vba
Kindly see the sample file
Sample002.xlsm
Avinash SinghAsked:
Who is Participating?
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You may try something like this...
Sub CompareColumnsCDE()
Dim lr As Long
With Application
    .Calculation = xlCalculationManual
    .EnableEvents = False
    .ScreenUpdating = True
End With
lr = Columns("B:C").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If lr > 1 Then
    Range("A2:A" & lr).Formula = "=B2=C2"
    Range("A2:A" & lr).Value = Range("A2:A" & lr).Value
End If
With Application
    .Calculation = xlCalculationAutomatic
    .EnableEvents = True
    .ScreenUpdating = True
End With
End Sub

Open in new window

0
 
KoenChange and Transition ManagerCommented:
why vba? if you put a formula in A  = if(b2=c2,True, False) it would achieve what you want, not ?
0
 
Avinash SinghAuthor Commented:
Thnx Again Neeraj sir for ur help and giving ur precious  time to my post
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You'r welcome Avinash!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.