title: vba extracting data underline
body: <p>I'm able to find all the underlines but I want to be able to eliminate the ones that are followed by a " (". How can I manipulate the array to check for a space and then " (" ? In the example below only "hello" would be extracted but "for" and "do" would not because those two are followed by a " (".</p>
  
  <p><a href="https://i.stack.imgur.com/bzdCY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bzdCY.png" alt="enter image description here"></a></p>
  
  <pre><code>Sub proj()
      Dim dataRng As range, cl As range
      Dim arr As Variant
  
      Set dataRng = Worksheets("ItalicSourceSheet").range("C1:C5") '&lt;--| change "ItalicSourceSheet" with your actual source sheet name
      With Worksheets("ItalicOutputSheet") '&lt;--|change "ItalicOutputSheet" with your actual output sheet name
          For Each cl In dataRng
              arr = GetItalics(cl) '&lt;--| get array with italic words
              If IsArray(arr) Then .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(UBound(arr) + 1) = Application.Transpose(arr) '&lt;--| if array is filled then write it down to output sheet first blank cell in column "A"
          Next
      End With
  End Sub
  
  Function GetItalics(rng As range) As Variant
      Dim strng As String
      Dim iEnd As Long, iIni As Long, strngLen As Long
  
      strngLen = Len(rng.Value2)
      iIni = 1
      Do While iEnd &lt;= strngLen
          Do While rng.Characters(iEnd, 1).Font.Italic And rng.Characters(iEnd, 1).Font.Underline
              If iEnd = strngLen Then Exit Do
              iEnd = iEnd + 1
          Loop
          If iEnd &gt; iIni Then strng = strng &amp; Mid(rng.Value2, iIni, iEnd - iIni) &amp; "|"
          iEnd = iEnd + 1
          iIni = iEnd
      Loop
      If strng &lt;&gt; "" Then GetItalics = Split(Left(strng, Len(strng) - 1), "|")
  End Function​
  </code></pre>