+ Reply to Thread
Results 1 to 3 of 3

mark duplicate cells with different color

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    SANGHAI
    MS-Off Ver
    Excel 2003
    Posts
    2

    mark duplicate cells with different color

    I currently face very tricky problem about excel. Here is the problem:
    I want to mark the duplicate cells in one colume with different color, and pick the corresponding individual cell IDs into another colume (like attached spreadsheet).

    Maybe VBA can do that? it will be appreciated for any suggestions or answers. thanks advance for any kind friends.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-15-2011
    Location
    SANGHAI
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: mark duplicate cells with different color

    Any help please?

  3. #3
    Registered User
    Join Date
    06-16-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: mark duplicate cells with different color

    Quote Originally Posted by seesun View Post
    Any help please?
    Sub Col_Index()
    '
    ' Macro1 Macro
    '

    '
    f = InputBox(Prompt:="Data in Column.", _
    Title:="Enter the Column", Default:="A") & i
    g = InputBox(Prompt:="Input index in Column.", _
    Title:="Enter the Column", Default:="B") & i
    h = InputBox(Prompt:="Output Index in Column.", _
    Title:="Enter the Column", Default:="C")




    Columns(f).Select
    With Selection.Interior
    .Pattern = xlNone
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With

    Columns(h).Select
    Selection.ClearContents
    K = 1
    For i = 1 To 65555
    a = f & i
    d = g & i
    e = h & K
    If (Sheets("Sheet1").Range(a).Interior.Pattern = xlNone) Then

    If (Sheets("Sheet1").Range(a).Value = vbNullString) Then
    Exit Sub
    End If
    For j = i To 65555
    b = "C" & j
    If (Sheets("Sheet1").Range(a).Value = Sheets("Sheet1").Range(b).Value) Then
    Range(b).Select
    With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = i * 34342
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    End If
    If (i = j) Then
    Sheets("Sheet1").Range(e).FormulaR1C1 = Sheets("Sheet1").Range(d).Value
    K = K + 1
    End If
    If (Sheets("Sheet1").Range(b).Value = vbNullString) Then GoTo up

    Next j
    End If





    up: Next i

    End Sub




    Please find the macro...
    Example as per the sheet attached...
    Data in column=c
    Input index in Column=b
    output index in column=f

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1