+ Reply to Thread
Results 1 to 5 of 5

Macro to delete entire rows based values in columns

  1. #1
    Registered User
    Join Date
    11-06-2008
    Location
    Nigeria
    MS-Off Ver
    EXCEL 2007
    Posts
    35

    Macro to delete entire rows based values in columns

    Hi all,
    I'm currently working on an excel sheet and need a macro that can delete entire rools based on values in column B. Attached is a sample of the sheet, row 1 to 72 is a letter template, but worksheet functions (Vlookup) is used to determine the values in row 24 to 54.
    I need a macro that will delete entire between rows 24 to 54 that have no value and if all the rows (24 to 54) has no value it should delete rows 1 to 72.

    Rows 73 to 144 is another letter template, among which rows 96 to 126 are the rolls that the values are determine by worksheet functions. Macro should also do same as the above template. this also apply to the remaining templates as i have up to 30 letter templates on the excel sheet.

    Many thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-06-2008
    Location
    Nigeria
    MS-Off Ver
    EXCEL 2007
    Posts
    35

    Re: Macro to delete entire rows based values in columns

    Hi all,
    I have not seen any reply on the be VBA, can someone help please?

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to delete entire rows based values in columns

    The below assumes if B is blank the row should be deleted & that the last row with data in Column B is always the last row of the last template.

    Without seeing the Formulae in place and/or a complete sheet with all templates in place it's hard to make any concrete assertions... as you've discovered the less info you provide the less likely you are to get an answer.

    Please Login or Register  to view this content.
    Change the text in red to reflect the name of the sheet containing the templates.

  4. #4
    Registered User
    Join Date
    11-06-2008
    Location
    Nigeria
    MS-Off Ver
    EXCEL 2007
    Posts
    35

    Re: Macro to delete entire rows based values in columns

    Many thanks Donkeyote, i have about 25 templates in the worksheet but it only work fine fot the last two templates while the VBA deleted some rows and left others for the other rows. Can you help to look at this.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to delete entire rows based values in columns

    It worked on the test file without incident. If the code does not work on your "real" file then quite plainly you will need to furnish us with another sample file that more accurately reflects your real set-up, perhaps even the real file ? Be sure to strip out any / all sensitive data prior to uploading.

+ 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