+ Reply to Thread
Results 1 to 7 of 7

sub to Delete Rows meeting specific requirements

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    Germany
    MS-Off Ver
    MS Office 2010/2013
    Posts
    9

    sub to Delete Rows meeting specific requirements

    Hi
    I do have a working function with deletes rows where in a specific column is either 13 or "" (Nothing) .
    Please Login or Register  to view this content.
    The bad thing in here is, that the 13 is hardcoded. I sometimes need in the code the 13, sometimes the 13 and 15.
    My solution now is having two subs one deleteRow13 and one deleteRow15.

    What I want is a sub that I can call with optional parameters
    e.g.
    Please Login or Register  to view this content.
    Did I make myself clear?
    Thanks for reading.
    Fabian

    P.S.
    While typing there formed another question:
    does it matter if I use for i = ... or for each cell in range

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

    Re: sub to Delete Rows meeting specific requirements

    Do you mean like this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-14-2014
    Location
    Germany
    MS-Off Ver
    MS Office 2010/2013
    Posts
    9

    Re: sub to Delete Rows meeting specific requirements

    AWSOME Fast response,
    thank you.
    Something like that, but sometimes
    • I need 13
    • I need 15
    • i need 15 AND! 13
    for the first to cases your code works, but not for the third. Though I could do
    call deleteRow13(...,13)
    call deleteRow13(...,15)
    But what I wanted is one procedurecall with two of them
    call deleteRow13(...,13, 15)

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

    Re: sub to Delete Rows meeting specific requirements

    Oh, I see:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: sub to Delete Rows meeting specific requirements

    hi FabianWinter, option, select range and run the code:

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: sub to Delete Rows meeting specific requirements

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    08-14-2014
    Location
    Germany
    MS-Off Ver
    MS Office 2010/2013
    Posts
    9

    Re: sub to Delete Rows meeting specific requirements

    Thank you guys, all solutions are helpful.

    @Norie EXACTLY what I needed Thank you very much.

+ 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. Delete a row If certain requirements are met
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2012, 11:04 AM
  2. Replies: 4
    Last Post: 08-01-2012, 07:31 AM
  3. Macro to delete rows meeting criteria
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2012, 05:21 AM
  4. Loop to delete rows meeting criteria
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2009, 04:54 PM
  5. how to create a formula to hide specific rows after meeting requi
    By DNelson in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-07-2006, 09:15 AM

Tags for this Thread

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