+ Reply to Thread
Results 1 to 19 of 19

Remove rows in a single cell when matching text found in the row

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212

    Remove rows in a single cell when matching text found in the row

    Hi

    I have scenario like below:

    For example a sample cell will be like:

    Test Outlook.pst and test path
    Temp Internet Calendar and test path
    Dummy SharePoint and Test site
    Find User.pst and True Site

    The above content are in one single cell and each row is separated by a carriage line break (char (10)).

    I want to look each cell in a column and remove only the lines in each cell which contains text "Internet Calendar" or "SharePoint" and return the rest of the content in the same single cell.

    The Output should look like this:

    "Test Outlook.pst and test path
    Find User.pst and True Site"

    Not sure if this is achievable i have been thinking but could not find a way to solve this.

    Best
    Rem0

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,762

    Re: Remove rows in a single cell when matching text found in the row

    Your post does not comply with Rule 3 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    Please make sure to include the full link, so that other members will be permitted to continue helping you

    Note that if you have fewer than 10 posts, you may need to type the link, or past it in pieces (or ask a mod to do that for you)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212

    Re: Remove rows in a single cell when matching text found in the row

    Apologies I have pasted the link on other forum but didnot added the link here:

    here you go:

    https://www.mrexcel.com/forum/excel-...found-row.html

  4. #4
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212

    Re: Remove rows in a single cell when matching text found in the row

    Hi Alan

    Any guidance on this issue will be of great help.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Remove rows in a single cell when matching text found in the row

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212
    Thanks Jindon

    I have tried your code but I’m getting type mismatch error on below.

    For i = 1 to ubound (a,1)

    Note: I know it needs to be inserted as code but I’m logged in mobile no options for me

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Remove rows in a single cell when matching text found in the row

    You might have value only in A1...
    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  8. #8
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Remove rows in a single cell when matching text found in the row

    Works perfectly with minor change
    Change to
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212
    Great it works for one cell

    Need this to loop through all valid cells in a column

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Remove rows in a single cell when matching text found in the row

    Then obviously your range has blanks...
    change to
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212
    Thanks it’s working great

    But noticed one discrepancy where texts like “\SharePoint” are not removed from the cell

  12. #12
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Remove rows in a single cell when matching text found in the row

    apologies repost

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Remove rows in a single cell when matching text found in the row

    Quote Originally Posted by Rem0ram View Post
    Thanks it’s working great

    But noticed one discrepancy where texts like “\SharePoint” are not removed from the cell
    Should remove,

    Post your workbook.

  14. #14
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212
    Did not get you what is oist your workbook

  15. #15
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212
    Can’t share wbook from office

    Line looks like below

    C:\users\xxxxxx\appdata\local\microsoft\outlook\SharePoint Lists.pst, 271360, (thu, 05 oct 2017 13:23:33 -0600)

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Remove rows in a single cell when matching text found in the row

    Removing and SHOULD remove.

    Upload your workbook, otherwise, just wasting time.

    I will have a sleep, so my next response will be sometime tomorrow.
    Last edited by jindon; 01-17-2019 at 12:05 PM.

  17. #17
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212
    Thanks jindon

    It only works for internet calendar but not SharePoint

    Not sure what’s the issue could nt do much either as I can’t share workbook

  18. #18
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Remove rows in a single cell when matching text found in the row

    Workbook attached works for both with Jindon's original code. Data in column A of Sheet1.
    Macro in Module1
    Attached Files Attached Files

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Remove rows in a single cell when matching text found in the row

    Quote Originally Posted by Rem0ram View Post
    It only works for internet calendar but not SharePoint

    Not sure what’s the issue could nt do much either as I can’t share workbook
    No idea why you can not upload a workbook, only just a data that is not working as I don't want to see your actual workbook.
    Possibilities;
    - Spelled wrong in pattern.
    - Case sensitive compare.

    If the latter, insert one line
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 11-27-2018, 07:17 AM
  2. [SOLVED] Search for the text in cell A1 in a list and remove the text if found in the list
    By kak0 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-24-2014, 11:01 PM
  3. Replies: 27
    Last Post: 06-06-2014, 05:30 PM
  4. Remove Duplicates and Multiple Rows into Single Cell with Commas.
    By bfitzpa in forum Access Tables & Databases
    Replies: 1
    Last Post: 06-05-2014, 07:42 AM
  5. [SOLVED] Concatenate rows into single cell, but remove last comma from row
    By djm601 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2013, 09:45 AM
  6. Replies: 2
    Last Post: 04-11-2013, 11:14 AM
  7. [SOLVED] Remove all rows after Value is found in column
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-03-2011, 04:28 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1