The code below are for comparing two diffrent sheets in one workbook. it compares rows in column A, and it works excelent. Do anyone know how to make it compare rows through all columns (A-M), and not just A? appriciate any help.
Sub Compare()
Dim LR As Long
Dim x As Range
Dim xr As Range
Application.ScreenUpdating = False
LR = Cells(Rows.Count, 1).End(3).Row
Sheets("Ny").Columns("N:N").Insert Shift:=xlToRight
Set xr = Sheets("Ny").Range("N2:N" & LR)
With xr
.Formula = "=IF(ISNA(VLOOKUP(A2,Aktuell!$A$2:$M$2000,1,false)),""Bold"","""")"
.Value = .Value
End With
For Each x In xr
If x.Value = "Bold" Then x.EntireRow.Font.Bold = True
Next
Sheets("Ny").Columns("N:N").Delete Shift:=xlToLeft
Application.ScreenUpdating = True
End Sub
Sub Compare()
Dim LR As Long
Dim x As Range
Dim xr As Range
Application.ScreenUpdating = False
LR = Cells(Rows.Count, 1).End(3).Row
Sheets("Ny").Columns("N:N").Insert Shift:=xlToRight
Set xr = Sheets("Ny").Range("N2:N" & LR)
With xr
.Formula = "=IF(ISNA(VLOOKUP(A2,Aktuell!$A$2:$M$2000,1,false)),""Bold"","""")"
.Value = .Value
End With
For Each x In xr
If x.Value = "Bold" Then x.EntireRow.Font.Bold = True
Next
Sheets("Ny").Columns("N:N").Delete Shift:=xlToLeft
Application.ScreenUpdating = True
End Sub