IDENTIFY & MARK THE DATA
Closed
kishan
-
May 10, 2010 at 02:54 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - May 11, 2010 at 01:07 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - May 11, 2010 at 01:07 AM
Related:
- IDENTIFY & MARK THE DATA
- The system could not identify your location viber - Guide
- E with accent mark - Guide
- Insert check mark in word - Guide
- Tmobile data check - Guide
- Mark sheet in excel - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
May 10, 2010 at 06:09 AM
May 10, 2010 at 06:09 AM
suppose your data is like this
hdng1 invoice
1 111
2 222
3 4444
4 5555
5 6666
-1 111
-2 3333
-4 4444
-7 77777
try this macro
the result will be
hdng1 invoice match?
1 111 match
2 222
3 4444
4 5555
5 6666
-1 111 match
-2 3333
-4 4444
-7 77777
if you want to retest the macro you have to delete the column C and rerun the macro . Is this what you want.
try the macro on your database sheet
hdng1 invoice
1 111
2 222
3 4444
4 5555
5 6666
-1 111
-2 3333
-4 4444
-7 77777
try this macro
Sub test() Dim r As Range, c As Range, cfind As Range Dim x Set r = Range(Range("A2"), Range("A2").End(xlDown)) For Each c In r 'c.Select x = (-1) * c.Value 'MsgBox x Set cfind = r.Cells.Find(what:=x, lookat:=xlWhole) If cfind Is Nothing Then GoTo nextc If c.Offset(0, 1) = cfind.Offset(0, 1) Then c.Offset(0, 2) = "match" End If nextc: Next c End Sub
the result will be
hdng1 invoice match?
1 111 match
2 222
3 4444
4 5555
5 6666
-1 111 match
-2 3333
-4 4444
-7 77777
if you want to retest the macro you have to delete the column C and rerun the macro . Is this what you want.
try the macro on your database sheet
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
May 11, 2010 at 01:07 AM
May 11, 2010 at 01:07 AM
now my data is like this
hdng1 invoice
1 111
2 222
3 4444
4 5555
5 6666
-1 111
-2 3333
-4 4444
-7 77777
-1 111
try this modified macro
hdng1 invoice
1 111
2 222
3 4444
4 5555
5 6666
-1 111
-2 3333
-4 4444
-7 77777
-1 111
try this modified macro
Sub test() Dim r As Range, c As Range, cfind As Range Dim x, cfind1 As Range, r1 As Range Set r = Range(Range("A2"), Range("A2").End(xlDown)) For Each c In r c.Select x = (-1) * c.Value 'MsgBox x Set cfind = r.Cells.Find(what:=x, lookat:=xlWhole) If cfind Is Nothing Then GoTo nextc If c.Offset(0, 1) = cfind.Offset(0, 1) Then Set r1 = Range(Range("A1"), c) If WorksheetFunction.CountIf(r1, -x) <= 1 Then c.Offset(0, 2) = "match" End If End If nextc: Next c End Sub
May 10, 2010 at 11:04 PM