How to handle negative lookbehind in Excel VBA regex?

Advertisements The Excel VBA code is using a regular expression to extract section numbers from HTML files. However, the regex includes a negative lookbehind which is not supported in VBA regex. "(?<!tbl"")>(\d(\.\d)+)<" Sub GetAllSectionNumbers() LRb = Cells(Rows.Count, "B").End(xlUp).Row Range("B7:C" & LRb).ClearContents Dim fileDialog As fileDialog Set fileDialog = Application.fileDialog(msoFileDialogOpen) fileDialog.AllowMultiSelect = True fileDialog.Title = "Select… Read More How to handle negative lookbehind in Excel VBA regex?

Partially color the name of a listcolumn

Advertisements I want to partially color the fourth column of the table object Sales after the 3 to the end to vbBlack. Currently, the entire column name font color is white. I’m trying the following, but it gives me an error saying an object is required. length = Len(Worksheets("Sales").ListObjects("Sales").ListColumns(4).Name) Worksheets("Sales").ListObjects("Sales").ListColumns(4).Name.Characters(Start:= 4, Length:=L).Font.Color = vbBlack >Solution… Read More Partially color the name of a listcolumn

How to include dynamic VLOOKUP in FormulaR1C1 VBA?

Advertisements I need to lookup values on another sheet. My formula works great, when i use it manually =VLOOKUP(TRIM(C2),TRIM(‘MyDataSheet’!$A$1:$E$500),4,FALSE) However, I need to be able to plug this formula into a cell dynamically using VBA. This is what I tried: Set lookupRange = ThisWorkbook.Sheets("MyDataSheet").Range("A1:E500") Set newCol = tbl.ListColumns.Add newCol.DataBodyRange.FormulaR1C1 = "=VLOOKUP(TRIM(RC[-16])," & lookupRange.Address(True, True, xlR1C1)… Read More How to include dynamic VLOOKUP in FormulaR1C1 VBA?