macro to comment on cells based on formula's (duplicate, length, no entry)

basil.licop

New Member
Joined
Jun 15, 2009
Messages
19
Hi All,

I need help making a macro that will scan for duplicates, length & empty cells.

I have the sample file below that does conditional formatting but it doesnt help as much because I want to show the reason for the highlight's on a comment instead.

sample file : http://www.mediafire.com/?sharekey=2b838b5f12f1d82cd8f14848abf485dde04e75f6e8ebb871

file that might help out: http://filedb.experts-exchange.com/incoming/2008/12_w51/86630/duplicate-finder-03.xls

checks would be:
column A - duplicates and/or length should not be over 100 characters
column B - duplicates
column F - should only contain 2 comma's(or 3 keywords)
all columns - check if no entries are found(empty cells)

Please help! I'm very noobish when it comes to macro's.

Thank you very much!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Change code for LENGTH > 100 by

Code:
'-----    LENGTH  >  100   --------
        If (Len(MYCELL) > 100) Then
'--      A  ALREADY  PREPARED  FROM  PREVIOUS  TEST
            If (A > 1) Then
                With Cells(MYCELL.Row, MYCELL.Column)
                    .ClearComments
                    .AddComment
                    .Comment.Visible = False
                    .Comment.Text Text:="Length  >  100  AND   Duplicate"""
                End With
            Else
                With Cells(MYCELL.Row, MYCELL.Column)
                    .ClearComments
                    .AddComment
                    .Comment.Visible = False
                    .Comment.Text Text:="Length  >  100"
                End With
            End If
        End If
You should be closed to be ready to pepare your own code now :-)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top