title: Insert space between text and number for cells within column
body: <p>I've already written a code that inserts a space between text and numbers, separating 'unspaced' days and months from dates, and it works as it's supposed to. </p>
  
  <p>The only problem is that I'm using an <code>If then</code> structure to determine which Regular Expressions <code>pattern</code> I should use. </p>
  
  <p>If the first character of the date is a number, then knowing that it is in the '<code>DayMonth</code>' sequence, I use this pattern: <code>"(.*\d)(?! )(\D.*)"</code>. Otherwise, assuming that it isn't in the <code>'DayMonth'</code> sequence but rather in the '<code>MonthDay</code>' sequence, I use the other pattern: <code>"(.*\D)(?! )(\d.*)"</code>.</p>
  
  <p><strong>Is there any way to use two patterns at once for the Regular Expressions object to scan through so that I can get rid of the <code>If Then</code> structure?</strong></p>
  
  <p>My code below:</p>
  
  <pre><code>Sub SpaceMonthDayIf()
  
  Dim col As Range
  Dim i As Long
  
  Set col = Application.InputBox("Select Date Column", "Obtain Object Range", Type:=8)
  
  With CreateObject("VBScript.RegExp")
  
      For i = 1 To Cells(Rows.Count, col.Column).End(xlUp).Row
  
          If IsNumeric(Left(Cells(i, col.Column).Value, 1)) Then
          .Pattern = "(.*\d)(?! )(\D.*)"
          Cells(i, col.Column) = .Replace(Cells(i, col.Column), "$1 $2")
  
          Else
          .Pattern = "(.*\D)(?! )(\d.*)"
          Cells(i, col.Column) = .Replace(Cells(i, col.Column), "$1 $2")
  
              End If
  
                  Next
  
                      End With
  
  End Sub
  </code></pre>
  
  <p>For clarity, here's what happens when I run my code:</p>
  
  <p><a href="https://i.stack.imgur.com/qEo7l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qEo7l.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/h50Ht.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h50Ht.png" alt="enter image description here"></a></p>