+ Reply to Thread
Results 1 to 8 of 8

Delete Cells

  1. #1
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    Delete Cells

    Hello

    I would like to create a VBA that can delete all rows with criterias that apply to cells in Column C

    from C1 to cell with TExt : "Brussels"

    and then from Cell with text :"Debit Count" till cell with text : "Paris"

    can anyone help please ?

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,264

    Re: Delete Cells

    Hi bimo,

    Welcome to the forum!!

    Try this - though initially on a copy of your data as the results cannot be undone if they're not as expected:

    Please Login or Register  to view this content.
    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Delete Cells

    Hi Robert

    thanks for the reply,

    unfortunately executing the macros make no changes to the excel sheet, I have attached the Data. hopefully this clarify what is happeing,

    Thanks again for the help.

    Bimo
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,264

    Re: Delete Cells

    Hi Bimo,

    Based on your criteria (or as I understood it) there are only 2 rows i.e. 142 and 426, to be deleted which are.

    The code will delete any row where the value in Col. C of that row is either "Brussels", "Debit Count" or "Paris". If that's not correct, please let me know what it should be and I'll try and code it.

    Robert

  5. #5
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Delete Cells

    Hi Robert

    Actually I would like to Delete all rows from 1 to 141 and then from 175 to 425 and then from 453 till end of Data

    Thanks

    Bimo

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,264

    Re: Delete Cells

    Hi Bimo,

    That's a lot different from your original requirement, but try this nonetheless (again on a copy of your data if the results are not as expected):

    Please Login or Register  to view this content.
    Regards,

    Robert

  7. #7
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Delete Cells

    Hi Robert

    It works, the only issues is row changes when the report is updated. So is it possible to instruct the delete of rows based on the content of Cells as per follow ?

    Delete All Rows from cell 1 on Colum C to Cell above Cell with text “Belgium”

    Delete All Rows from cell, the one above Cell with Text “Stockholm” on column C to Cell above Cell with text “Paris”

    Delete All Rows from cell, the one above Cell with Text “Vienna” on column C till end of Data, usually not beyond Row 1500


    Sorry for the miscommunication, I should have been clearer from the start

    Bimo,

  8. #8
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,264

    Re: Delete Cells

    There is no mention of Belgium in the sample workbook you posted

    I don't think I'm able to help you on this one. Hopefully someone on the forum will be able to though.

    Robert

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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