+ Reply to Thread
Results 1 to 11 of 11

find the part of text and delete the row and loop continues

  1. #1
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    find the part of text and delete the row and loop continues

    Hi,

    Help me out with a script for the below requirement.

    i have 40000 rows in only cell A. now out of that i want to delete the rows by finding out the part of the text and the loop should continue till the cell A is having a blank cell that is A40001.

    Regards,
    Vimala

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: find the part of text and delete the row and loop continues

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: find the part of text and delete the row and loop continues

    hi,

    thanks for the quick response....

    but the macro is not moving to next row...

    i will give my example again

    Column A

    date of the transaction
    MCP id
    MCP number
    time of the transaction
    amount
    2349q3845792
    location india
    3408208957294
    date of the transaction
    MCP id
    process sdkjfoawier
    amount
    2349q3845792
    3408208957294

    this is how my data look likes till the 40000 rows.... now i want to delete the rows which are begining with loction and process in the entire data....

    by using a loop

    please help me on this....

    regards,
    vimala

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: find the part of text and delete the row and loop continues

    Hi, providing that you change "part of the text" to "location" then the macro will delete the rows beginning with location. i.e. with that data in column A on the activesheet, run this macro:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: find the part of text and delete the row and loop continues

    no its still not deleting the rows.....

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: find the part of text and delete the row and loop continues

    Hi,

    Please find attached an example workbook.

    It includes a macro in module 1, and before and after sheets.

    The before sheet is the layout of the data as you provided and the after sheet is after I ran the code in module 1.

    Could you confirm that the after sheet is what you mean by the rows being deleted? Does the code not perform this when you run it?
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: find the part of text and delete the row and loop continues

    yes............... in your work book it is working...

    am using 2010 version and cursor is not even moving to the next cell in my work book... and the rows are not getting deleted...

    it is not even prompting that it is done....

    no activity is taking place in the sheet when I am running this.... macro

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: find the part of text and delete the row and loop continues

    Hi - please upload the workbook for which it does not work (it doesn't need to be the full thing, just a reduced size version for which the code doesn't work and with sensitive data removed). To upload a workbook click go advanced and then attachments from the reply window.

  9. #9
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: find the part of text and delete the row and loop continues

    Hi,

    in the attached excel i need to delete the lines which are starting with location, mcp, last.

    regards,
    vimala
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: find the part of text and delete the row and loop continues

    Hi,

    The instr function is case sensitive so you would need to change "location" to "Location" for it to work in the attached file. Alternatively:

    Please Login or Register  to view this content.
    would not be case sensitive.

  11. #11
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: find the part of text and delete the row and loop continues

    amazing.............. this is working out

    thanks alot

+ 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. Do-While loop continues unexpectedly
    By Motox in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2012, 08:40 PM
  2. Find/Replace Macro Error 1004 part way though loop?
    By macronoob123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-03-2011, 06:34 PM
  3. Find part of string and delete
    By thedivvy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2009, 11:48 AM
  4. Replies: 2
    Last Post: 02-21-2006, 08:40 AM
  5. Find part of string & delete row
    By Les Stout in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2005, 11:05 AM

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