View Single Post
  #1   Report Post  
PenguinDance PenguinDance is offline
Junior Member
 
Posts: 1
Default Macro that will ignore all information within Parentheses

I have a column of cells that contains a short bio on a person. For example:

(NAME: CHAD SMITH) HE IS A PERSONAL COMPUTER (PC) USER WHO ENJOYS PLAYING GAMES ON HIS SUPER NINTENDO (SNES). HE ALSO ENJOYS VOLLEYBALL (VBALL) AND BASKETBALL. (WRITTEN BY: JOHN JONES).

I would like a macro that puts all the NON parentheses text into sentence case (NOT PROPER CASE), but leave the text within the parentheses unchanged.

I found and successfully ran this Macro which puts everything into sentence case:

Sub SentenceCase()
For Each cell In Selection.Cells
s = cell.Value
Start = True
For i = 1 To Len(s)
ch = Mid(s, i, 1)
Select Case ch
Case "."
Start = True
Case "?"
Start = True
Case "a" To "z"
If Start Then ch = UCase(ch): Start = False
Case "A" To "Z"
If Start Then Start = False Else ch = LCase(ch)
End Select
Mid(s, i, 1) = ch
Next
cell.Value = s
Next
End Sub

It works great, but I want everything within the parentheses to be ignored. Anyway I can do that? Thanks in advance for all your help!