Change
With Sheets("User to System Matrix").Cells(1).Resize(UBound(a, 1), UBound(a, 2))
.CurrentRegion.ClearContents
.Value = a
Sheets("Verification Details").Cells(1).CurrentRegion.Rows(1).Copy .Cells(1, .Columns.Count + 1)
With .Columns(.Columns.Count + 1).Offset(1).Resize(.Rows.Count - 1)
' .Formula = "=iferror(vlookup(a2,'Known Users'!a:b,2,false),"""")"
.Formula = "=if(vlookup(a2,'Known Users'!a:b,2,false)="""","""",vlookup(a2,'Known Users'!a:b,2,false))"
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=" & .Cells(1).Address(0, 0) & "="""""
.FormatConditions(1).Interior.Color = vbRed
End With
End With
to
With Sheets("User to System Matrix").Cells(1).Resize(UBound(a, 1), UBound(a, 2))
.CurrentRegion.ClearContents
.Value = a
With .Cells(1, 3).Resize(, UBound(a, 2) - 2)
.Orientation = 90
.Columns.AutoFit
End With
Sheets("Verification Details").Cells(1).CurrentRegion.Rows(1).Copy
With .Cells(1, .Columns.Count + 1)
.PasteSpecial 8
.PasteSpecial
End With
With .Columns(.Columns.Count + 1).Offset(1).Resize(.Rows.Count - 1)
' .Formula = "=iferror(vlookup(a2,'Known Users'!a:b,2,false),"""")"
.Formula = "=if(vlookup(a2,'Known Users'!a:b,2,false)="""","""",vlookup(a2,'Known Users'!a:b,2,false))"
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=" & .Cells(1).Address(0, 0) & "="""""
.FormatConditions(1).Interior.Color = vbRed
End With
End With
Bookmarks