Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Data Cleansing & Text Formulas with Excel 2010

Posted on 2012-03-11
3
Medium Priority
?
373 Views
Last Modified: 2012-03-12
Hello Experts,

I'm looking for a text formula or VBA code for removing any text between brackets. For example, the following text:
OMI (ANNEM) (DRAMA EDIT V.)

should be corrected to:
OMI

Another text will have one set of brackets only like the folowing:
LOONEY TUNES (RE-RUN)

This also to be corrected to:
LOONEY TUNES

The text is supplied in Excel sheet in one column, so I can either apply a formula in the adjacent column or loop through the range (For each cell in myRange), depending on the suggested solution.

Thanks in advance for your help,
Hani
0
Comment
Question by:Mehawitchi
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 2000 total points
ID: 37706838
Sub supprparen()
For Each cel In Range("A:A")
Do While InStr(cel, "(") > 0
cel.Value = Replace(cel, Mid(cel, InStr(cel, "("), InStr(cel, ")") - InStr(cel, "(") + 1), "")
Loop
Next cel
End Sub
0
 

Author Closing Comment

by:Mehawitchi
ID: 37706990
Thank you ssaqibh

This is exactly what I needed
0
 

Author Comment

by:Mehawitchi
ID: 37709140
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question