score:2
Accepted answer
In the case of three or more consecutive uppercase letters, the matches do overlap. The remedy is to apply the pattern twice in a row:
With objRegex
.Global = True
.Pattern = "([A-Z])([A-Z])"
SplitCaps = .Replace(strIn, "$1 $2")
SplitCaps = .Replace(SplitCaps, "$1 $2")
End With
Source: stackoverflow.com
Related Query
- Splitting consecutive uppercase letters with VBA in Excel
- Find consecutive uppercase letters in Excel column
- Excel cells values with special letters not recognized when sent to Google Search via VBA
- I need an algorithm that count the number of words in column M that start with letters "a" and "A" in excel VBA
- Find and Replace Any Letters and Everything after with "" Excel VBA
- Splitting Sheets with Same Name Range in One Excel Workbook - Excel VBA
- VBA Instant conversion of letters to Uppercase upon population of Excel Cell
- Keeping Specific Text line in a cell for specific starting letters with excel vba
- Adding data into consecutive excel sheets with VBA
- VBA Excel match A with either column D or E if first three letters match otherwise write "there"
- Error in finding last used cell in Excel with VBA
- Excel VBA App stops spontaneously with message "Code execution has been halted"
- Open Excel file for reading with VBA without display
- Detect merged cells in VBA Excel with MergeArea
- How to insert a picture into Excel at a specified cell position with VBA
- Hiding an Excel worksheet with VBA
- Performing SQL queries on an Excel Table within a Workbook with VBA Macro
- excel vba call subroutine with variables
- Check if a value is in an array or not with Excel VBA
- Excel VBA calling sub from another sub with multiple inputs, outputs of different sizes
- Get the content of a sharepoint folder with Excel VBA
- Renaming Files with Excel VBA
- Ping IP Address with VBA code and return results in Excel
- How to add events to Controls created at runtime in Excel with VBA
- VBA for Excel throws "Object variable or with block variable not set" when there is no Object
- Rename Excel Sheet with VBA Macro
- Saving an Excel sheet in a current directory with VBA
- Export sql query results to excel using vba with headers
- Excel (2007) VBA - .Formula with quotes in it
- How to do a "Save As" in vba code, saving my current Excel workbook with datestamp?
More Query from same tag
- Upload Excel worksheets to AS400
- Hide/Unhide Rows
- VBA: Why are For Each loops faster than For loops?
- In vsto C#, when copying(no pasting) a range, how to know this range(row/col/rect info)?
- vba coding identify negative numbers then perform equation
- VBA Data Download From Web w/out Affecting Other Tasks?
- Copy Paste Cell beginning with equal sign (=====)
- Connect references (Tools>References) with VBA code (macros)
- filtering based on array in VBA
- Insert a new column before a certain column based on row header-VBA
- How Do I Disable a VBA Sub Using Another Sub
- Word VBA Find/Replace Issue
- Excel VBA: Batch renaming sheets
- Zip CSV File using Excel VBA
- Excel VBA - Populate a column on one sheet with values from another sheet based on 3 criteria (complicated IF AND related VBA with wildcards)
- Array: Compile Error. Wrong number of variables
- Add a calculated field in Pivot Table
- VBA Resizing a Current Region to omit bottom row
- Pivot table Run Time error 1004: Application-defined or object defined error
- How to square an imaginary number in VBA?
- Delete visible filtered Rows, Run-time error 1004:Cannot use that command on overlapping selections
- Error 91 when using Find Function, Using ActiveCell?
- Match value in another sheet and copy data to current sheet
- Nested IF statements VBA
- VB Forms INSERT INTO statement, Changing Password Form
- VLookup Macro for Changing Column Reference
- My VBA for loop in MS word 2016 is not working
- How do I make a .dll created with IKVM com visible?
- Excel VBA Clear Contents
- vbNewline vs Chr(10) as linebreak delimiter in Windows vs. Mac OSX