![]() Press the Alt + Q keys to exit the Microsoft Visual Basic for Applications window and go back to the worksheet.Ħ. Then check the Microsoft Script Runtime box in the References – VBAProject dialog box. After inserting the two codes, then click Tools > References. XDic.Add, xFindCell.Offset(0, xCol - 1).AddressĤ. LookupKeepColor = xFindCell.Offset(0, xCol - 1).Value Set xFindCell = LookupRng.Find(FndValue,, xlValues, xlWhole) VBA code 2: Vlookup and return background color with the lookup value Public xDic As New Dictionaryįunction LookupKeepColor (ByRef FndValue, ByRef LookupRng As Range, ByRef xCol As Long) Then click Insert > Module, and copy the below VBA code 2 into the Module window. Range(xDic.Keys(I)).Interior.Color = xlNoneģ. VBA code 1: Vlookup and return background color with the lookup value Sub Worksheet_Change(ByVal Target As Range) In the opening Microsoft Visual Basic for Applications window, please copy below VBA code into the Code window. ![]() In the worksheet contains the value you want to vlookup, right-click the sheet tab and select View Code from the context menu. Please do as follows to lookup a value and return its corresponding value along with background color in Excel.ġ. Amazing! Using Efficient Tabs in Excel Like Chrome, Firefox and Safari! Save 50% of your time, and reduce thousands of mouse clicks for you every day! ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |