LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
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!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro ignore formulas puiuluipui Excel Discussion (Misc queries) 3 October 19th 09 09:54 PM
macro - ignore row puiuluipui Excel Discussion (Misc queries) 8 September 10th 09 04:31 PM
Ignore macro run time error phil Excel Discussion (Misc queries) 4 March 27th 08 12:11 PM
Have macro ignore error Seth Excel Programming 3 June 19th 07 07:00 PM
Easy question: Have macro ignore #N/A Paul987[_19_] Excel Programming 2 March 27th 06 09:27 PM


All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"