VBA Excel Replace last 2 digits of number if occurs at beginning of string
问题 I'm trying to replace the last two digits of number with " XX BLOCK " if it occurs at the start of the string and has more than 2 digits. I'm using the Microsoft VBScript Regular Expressions 5.5 reference. Dim regEx As New RegExp With regEx .Global = True 'Matches whole string, not just first occurrence .IgnoreCase = True 'Matches upper or lowercase .MultiLine = True 'Checks each line in case cell has multiple lines .pattern = "^(\d{2,})" 'Checks beginning of string for at least 2 digits End