charlests,
1. What version of Excel and Windows are you using?
2. Are you using a PC or a Mac?
In the future when asking for help you should give us a screenshot of your raw data, and, also give us a screenshot of what the results should look like.
If I understand you correctly.
I assume that your raw data contains titles in row 1.
And, you only have to loop thru column A.
Sample raw data:
Excel 2007 |
---|
|
---|
| A | B | C | D | E | F | G |
---|
1 | Title A | Title B | Title C | Title D | Title E | Title F | Title G |
---|
2 | 1 | | | | | | 11 |
---|
3 | 2 | | | | | | 12 |
---|
4 | 3 | | | | | | 5 |
---|
5 | 4 | | | | | | 8 |
---|
6 | 5 | | | | | | 13 |
---|
7 | 6 | | | | | | 14 |
---|
8 | 7 | | | | | | 2 |
---|
9 | 8 | | | | | | 15 |
---|
10 | 9 | | | | | | 16 |
---|
11 | 10 | | | | | | 3 |
---|
12 | | | | | | | |
---|
|
---|
After the macro:
Excel 2007 |
---|
|
---|
| A | B | C | D | E | F | G |
---|
1 | Title A | Title B | Title C | Title D | Title E | Title F | Title G |
---|
2 | 1 | | Not Match | | | | 11 |
---|
3 | 2 | | Match | | | | 12 |
---|
4 | 3 | | Match | | | | 5 |
---|
5 | 4 | | Not Match | | | | 8 |
---|
6 | 5 | | Match | | | | 13 |
---|
7 | 6 | | Not Match | | | | 14 |
---|
8 | 7 | | Not Match | | | | 2 |
---|
9 | 8 | | Match | | | | 15 |
---|
10 | 9 | | Not Match | | | | 16 |
---|
11 | 10 | | Not Match | | | | 3 |
---|
12 | | | | | | | |
---|
|
---|
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code
2. Open your NEW workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Sub MatchAtoG()
' hiker95, 05/02/2014, ME775105
Dim c As Range, grng As Range
Application.ScreenUpdating = False
For Each c In Range("A2", Range("A" & Rows.Count).End(xlUp))
Set grng = Columns(7).Find(c, LookAt:=xlWhole)
If grng Is Nothing Then
c.Offset(, 2).Value = "Not Match"
ElseIf Not grng Is Nothing Then
c.Offset(, 2).Value = "Match"
Set grng = Nothing
End If
Next c
Columns(3).AutoFit
Application.ScreenUpdating = True
End Sub
Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension
.xlsm
Then run the
MatchAtoG macro.