Macro Help

  • Thread starter Thread starter briandhowells
  • Start date Start date
B

briandhowells

Hi,

I'm looking for a macro that will take a column of data that look like
this

B. Tallackson (1)
I. Pikkarainen (1)
J. Pushor (1)
A. Murray (1)
B. Simon (33)
M. Hartigan (51)
G. Platt (1)
P. Vrana (31)

and delete the paranthases and any numbers in them.

Much appreciated.

Thanks!
 
I'm guessing you want the trailing space gone too.

Sub DeleteParan()
Dim r As Range
Dim r1 As Range
Dim p As Long
Set r = Columns("A") 'Change as needed
For Each r1 = r.Cells
p = InStr(1,r1,"(")
If p > 0 Then
r1 = Trim(Left(r1, p - 1))
End If
Next
End Sub

HTH

Charles Chickering
 
Maybe you don't need a macro:
select the range to fix
edit|Replace
what: (* (open paren, followed by an asterisk)
with: (leave blank)
replace all

You may want to replace " (*" -- spacebar, open paren, then asterisk.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top