Results 1 to 4 of 4

Macro to ckeck duplicated file name

Threaded View

  1. #1
    Registered User
    Join Date
    09-16-2012
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    11

    Macro to ckeck duplicated file name

    Hi!

    i'm trying to creat a macro that looks in column A and B. after that it check if column A have the same file name as B if not it will mart with the color red. and same with the B column.
    But i dosent work.

    
    Sub Kontroll()
        Dim Name1 As String
        Dim Name2 As String
        Dim iRow() As Integer
        Dim iRows() As Integer
        Dim i As Integer
        Dim j As Integer
        
        iRow = Sheets("Kontroll").Range("A2").CurrentRegion.Rows.Count
        iRows = Sheets("Kontroll").Range("B2").CurrentRegion.Rows.Count
        
        For i = LBound(iRow) To UBound(iRow)
            For j = LBound(iRows) To UBound(iRows)
                Name1 = Sheets("Controll").Range("A" & i).Value
                Name2 = Sheets("Controll").Range("B" & j).Value
                
                If Name1 <> Name2 Or Name2 <> Name1 Then
                    Sheets("Controll").Range.Range("A" & j).Interior.Color = 255
                End If
            Next j
        Next i
    End Sub
    thx in advance
    Last edited by newapa; 09-26-2012 at 10:31 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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