+ Reply to Thread
Results 1 to 8 of 8

loop

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

    loop

    hi,

    can some pls help with the script which gives

    do

    if "the cell begins with a particular word"

    select the entire row

    delete

    move to next row

    end loop if the row is blank

    script ends

    regards,
    vimala K

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: loop

    Please use code tags when posting.

    Please Login or Register  to view this content.
    Assumes the particular word is "word" and the values are in Column "A".

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

    Re: loop

    do i need to give the entire text of the cell which i want to delete....

    i just want to give the starting word of the cell...

    by using the above script cursor is not moving from cell a1 and no action is taking place in the work book

    regards,
    vimala

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: loop

    If i could respectfully amend John's code this might make it a little easier for the OP to edit to there desire:

    Please Login or Register  to view this content.
    Edit: I just noticed that this may be a cross post http://www.excelforum.com/excel-prog...continues.html.
    Last edited by stnkynts; 09-03-2014 at 10:56 AM.

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

    Re: loop

    macro is running only between the below lines

    If Left(Range("A" & i), lCount) = str Then Rows(i).Delete
    Next i



    and no rows are getting deleted

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

    Re: loop

    Hi,

    in the attached excel i want to delete the rows which are starting with location, mcp and last

    regards,
    vimala
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: loop

    It would have been nice if you would have mentioned multiple words. I am curious how you tried to put the multiple words in to get it to work. Also, you were probably experiencing a "case" issue.

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: loop

    Another:

    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. HOW TO: Pause loop, fix error on a popup UserForm, continue loop
    By AndyMachin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-19-2014, 04:37 PM
  2. Loop through multiple files and call macros (but unable to loop)
    By ryanpetersen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-23-2014, 12:04 PM
  3. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  4. Why did an inner loop variable start overwriting the outer loop range suddenly?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2012, 03:24 PM
  5. Replies: 0
    Last Post: 07-20-2010, 11:42 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