sourabh_ajmera
New Member
- Joined
- Jul 17, 2014
- Messages
- 36
Hello everybody,
I am stuck on a small problem. Please help me out. I have tried couple of things as pasted in the code below.
I have to validate data in column A with data in column C
Each cell data in A should match its corresponding cell data in C. e.g: A1 = C1, A2 = C2....so on
If they dont match macro should give an error and stop the execution on user input choice.
I have the following formula in Column B "=IF(ISERROR(MATCH(A1,C1:C1,0)),"",A1)" which is draged down till Cell B100 (This tells me if the values are same or not)
Even when the values dont match, the macro doesnt give any error
Please refer the code below.
Please help me out even if its a small mistake as I am beginner. Thank you.
I am stuck on a small problem. Please help me out. I have tried couple of things as pasted in the code below.
I have to validate data in column A with data in column C
Each cell data in A should match its corresponding cell data in C. e.g: A1 = C1, A2 = C2....so on
If they dont match macro should give an error and stop the execution on user input choice.
I have the following formula in Column B "=IF(ISERROR(MATCH(A1,C1:C1,0)),"",A1)" which is draged down till Cell B100 (This tells me if the values are same or not)
Even when the values dont match, the macro doesnt give any error
Please refer the code below.
Code:
Sub Value_Check()
Dim vLRow As Integer
vLRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).row
Dim rRng As Range
For i = 1 To vLRow
Range("B" & i).Select
Set rRng = Sheets("Verify").Range("B" & i)
If IsEmpty(rRng.Value) Then
If MsgBox("Accounts dont match. Stop Macro?", vbYesNo) = vbYes Then Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
End Sub
Please help me out even if its a small mistake as I am beginner. Thank you.
Last edited: