siraj rehman
New Member
- Joined
- Dec 16, 2019
- Messages
- 17
- Office Version
- 2016
- Platform
- Windows
conditional formatting is reading the text in vlookup and changing colour it should not happen.
=IFERROR(IF($B7>0,VLOOKUP($B7,DATA_BASE!$A$2:$B$100000,2,FALSE),""),"NOT FOUND IN DATABASE")
Range("J2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("K2").Select
Range(Selection, Selection.End(xlDown)).Select
With Application.ReplaceFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = vbRed
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Replace What:="NOT FOUND IN DATABASE", Replacement:="", LookAt _
:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Range("N2").Select
Range(Selection, Selection.End(xlDown)).Select
With Application.ReplaceFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = vbRed
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Replace What:="+", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
End Sub
=IFERROR(IF($B7>0,VLOOKUP($B7,DATA_BASE!$A$2:$B$100000,2,FALSE),""),"NOT FOUND IN DATABASE")
Range("J2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("K2").Select
Range(Selection, Selection.End(xlDown)).Select
With Application.ReplaceFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = vbRed
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Replace What:="NOT FOUND IN DATABASE", Replacement:="", LookAt _
:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Range("N2").Select
Range(Selection, Selection.End(xlDown)).Select
With Application.ReplaceFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = vbRed
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Replace What:="+", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
End Sub