Hello,
I've got myself a little stuck!! Any help would be very much appriciated!
I am using excel 2003, Please see the linked example workbook below:
https://app.box.com/s/wkv1yn5040t3wolorz8u
I have a workbook with two sheets, the first is a random splattering of words and numbers the second is a list of numbers with a alpha numeric id for each.
I need a macro to search for a 7 digit number in the first sheet.
Once found look at the list of numbers in the second sheet and if the number appears more than once;
to highlight the cell in the first sheet blue, and add a comment containing the alpha numeric id of the number in the second sheet.
Then loop to find the next 7 digit number in the first sheet, etc.
I have got a macro that finds the duplicates and lables from a list of numbers within the same sheet but i am have trouble with the first part the "search" bit.
The macros for tester (below) and reset are in module 1.
Thanks,
Mike
I've got myself a little stuck!! Any help would be very much appriciated!
I am using excel 2003, Please see the linked example workbook below:
https://app.box.com/s/wkv1yn5040t3wolorz8u
I have a workbook with two sheets, the first is a random splattering of words and numbers the second is a list of numbers with a alpha numeric id for each.
I need a macro to search for a 7 digit number in the first sheet.
Once found look at the list of numbers in the second sheet and if the number appears more than once;
to highlight the cell in the first sheet blue, and add a comment containing the alpha numeric id of the number in the second sheet.
Then loop to find the next 7 digit number in the first sheet, etc.
I have got a macro that finds the duplicates and lables from a list of numbers within the same sheet but i am have trouble with the first part the "search" bit.
The macros for tester (below) and reset are in module 1.
Code:
Sheets("Sheet2").Select
For MY_WORDS = 1 To Range("F3").End(xlDown).Row
MY_WORD = Range("F" & MY_WORDS).Value
For MY_ROWS = 1 To Range("A3").End(xlDown).Row
If Range("A" & MY_ROWS).Value = MY_WORD Then
MY_COUNT = MY_COUNT + 1
MY_COMMENT = MY_COMMENT & Range("C" & MY_ROWS).Value _
& Range("D" & MY_ROWS).Value & Chr(10)
End If
Next MY_ROWS
If MY_COUNT > 1 Then
Range("F" & MY_WORDS).AddComment
Range("F" & MY_WORDS).Comment.Text Text:=MY_COMMENT
Range("F" & MY_WORDS).Comment.Shape.TextFrame.AutoSize = True
Range("F" & MY_WORDS).Interior.Color = vbBlue
End If
MY_COMMENT = ""
MY_COUNT = 0
Next MY_WORDS
Thanks,
Mike