How can I remove the trailing & leading spaces even if it is in brackets from the cell?
The following code is fine but for MS Access. How can I use the similar code in Excel to get the result?
Code:
Private Function Spaces(strText As String) As String
Return String.Join(" ", strText.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
End Function