ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Help (https://www.excelbanter.com/excel-programming/373832-macro-help.html)

[email protected][_2_]

Macro Help
 
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!


Die_Another_Day

Macro Help
 
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

wrote:
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!



Dave Peterson

Macro Help
 
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.

" wrote:

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!


--

Dave Peterson

Dave Peterson

Macro Help
 
ps, you could record a macro while you did it manually if you really wanted
code.

" wrote:

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!


--

Dave Peterson


All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com