Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 7 of 7

Thread: Remove Text With Brackets & The Parenthesis

  1. #1
    Join Date
    27th April 2004
    Posts
    40

    Remove Text With Brackets & The Parenthesis

    I have a spreadsheet with 900 rows. All of the rows hold different information. The first column has contents such as this:

    This is the text (please remove me)
    This is some more text (I need to be removed too)

    I want to remove from every cell, everything in the brackets - so everything from the first open brackets to the end of the cell contents). Every cell is a different length and the information within the brackets is different.

    Please could someone help me?

    thanks

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    15th April 2003
    Location
    USA
    Posts
    7,352

    Re: Remove End Of Cell Contents

    Try
    VB:
    Sub EliminateEndings() 
        Dim i As Long, j As Long, n As Long 
        Application.ScreenUpdating = False 
        n = Cells(Rows.Count, 1).End(xlUp).Row 
        For i = 2 To n 'assumes header
            j = InStr(Cells(i, 1), "(") 
            If j > 0 Then Cells(i, 1) = Trim(Left(Cells(i, 1), j - 1)) 
        Next i 
        Application.ScreenUpdating = True 
    End Sub 
    
    
    Please do not U2U (private message) me directly for questions that should be posted to the forum; any such U2Us will be ignored.

  3. #3
    Join Date
    27th April 2004
    Posts
    40

    Re: Remove End Of Cell Contents

    Thank you for the reply. Unfortunately I don't have knowledge of VB so please could you let me know what i should do with the code? I'm sure its very obvious but not to me! :-) Thanks

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    14th July 2007
    Posts
    759

    Re: Remove End Of Cell Contents

    If you are just trying to remove everything inside of the parentheses, you don't need VBA. Just goto Edit, Replace. In the Find What: box, type (*)
    Leave the Replace With: box blank.

    Excel Video Tutorials / Excel Dashboards Reports


  5. #5
    Join Date
    18th September 2005
    Location
    Hampshire, UK
    Posts
    1,278

    Re: Remove End Of Cell Contents

    Another option would be to select the column and go Data>TextToColumns, select Delimited>Check the Other box and use an opening parenthesis "(" as the delimiter>on the next screen choose not to import the second column (ie everything after the first parenthesis>Finish.

    Richard

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    27th April 2004
    Posts
    40

    Re: Remove End Of Cell Contents

    Thanks to all for your replies. NOt sure what i did wrong on your reply turtle, but it didn't work for me. Parsnip - worked exactly how i needed it. Thanks for all the help.

    Excel Video Tutorials / Excel Dashboards Reports


  7. #7
    Join Date
    1st December 2010
    Posts
    1

    Re: Remove End Of Cell Contents

    Quote Originally Posted by RichardSchollar View Post
    Another option would be to select the column and go Data>TextToColumns, select Delimited>Check the Other box and use an opening parenthesis "(" as the delimiter>on the next screen choose not to import the second column (ie everything after the first parenthesis>Finish.

    Richard

    I know it's more than 3 years later, but just wanted to say thanks, that tip helped me a lot!

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Possible Answers

  1. Replies: 5
    Last Post: December 1st, 2012, 00:39
  2. Remove Parenthesis (Brackets) From Numbers
    By twin9000 in forum EXCEL HELP
    Replies: 10
    Last Post: February 3rd, 2009, 10:02
  3. Remove Parenthesis & Text Within From Range
    By Styler001 in forum EXCEL HELP
    Replies: 7
    Last Post: February 21st, 2008, 14:55
  4. Extract Data in Brackets/Parenthesis
    By Belinea in forum EXCEL HELP
    Replies: 10
    Last Post: June 10th, 2007, 20:36
  5. Calculate Number in Brackets/Parenthesis
    By eowplum in forum EXCEL HELP
    Replies: 5
    Last Post: July 28th, 2006, 15:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno