+ Reply to Thread
Results 1 to 13 of 13

deleteing rows

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    deleteing rows

    Hey, I have a worksheet which contains a different amount of rows used each time but i have dates set up already, once the data is inputed i need to run a macro which deletes all dates that are not used. I fill in data in Column B and i need to delete all rows when column B has a cell with null value, this is what i have:

    Please Login or Register  to view this content.
    But this isnt working, can someone please help, thanks,

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: deleteing rows

    Why have you got dates already in the sheet? Attach an example workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: deleteing rows

    because i send it out to clients, and they fill in the data, i need the dates to be set up the same, so that is why.

  4. #4
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: deleteing rows

    Example.ziphere is a copy,

  5. #5
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: deleteing rows

    any ideas?

  6. #6
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: deleteing rows

    HEy, i have been trying another method here is what i have:
    Please Login or Register  to view this content.
    Still no luck, I have it selecting the possible entries, however i cant get it to delete the row when the cell is empty.

  7. #7
    Forum Contributor
    Join Date
    08-09-2012
    Location
    British Columbia
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: deleteing rows

    Your macro finds the last used cell in column B and then steps UP to row 2 looking for blank cells in B and actually will work if it finds a blank cell.
    If you are wanting to delete the rows with blank B at the bottom of the sheet of the example you posted it will require finding the last row used in your date column.

  8. #8
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: deleteing rows

    how would i set it up to see with the date column?

  9. #9
    Forum Contributor
    Join Date
    08-09-2012
    Location
    British Columbia
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: deleteing rows

    Using the example sheet you posted I blanked a couple of B cells and ran your original macro.
    The rows with blank Bs were deleted.
    Then ran this code

    Please Login or Register  to view this content.
    and all rows at bottom with unused Bs were deleted.

  10. #10
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: deleteing rows

    is this what you are after?
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: deleteing rows

    Try this

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: deleteing rows

    thanks for the help guys i used no sparks solution

  13. #13
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: deleteing rows

    Why use a Loop?

+ 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