+ Reply to Thread
Results 1 to 7 of 7

Delete sheet by condition

  1. #1
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Delete sheet by condition

    good morning everyone.

    I've searched the forum for a macro to delete sheet with a condition.
    but this to me to be difficult to find one that can change.


    what I intend to do is a macro to delete a certain and particular sheet is the same in one cell does not contain a certain value and determined.


    can help me.

    best regards
    Last edited by Birnen; 07-06-2014 at 05:55 AM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Delete sheet by condition

    Probably I can't help you enough.

    But your description to determine the condition of deleting the sheet is not clear to me.

    You mean a cell on the sheet

    or

    you mean a sheetname

    or

    if a cell in a cell in a particular sheet is the same a a cell in another sheet.

    More info is needed.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Delete sheet by condition

    I apologize for my information to be little short.


    I intend in reality, for example.


    if in cell A1 does not contain the word 'hello', then I want the macro to delete this entire sheet.

    best regards

    Quote Originally Posted by oeldere View Post
    Probably I can't help you enough.

    But your description to determine the condition of deleting the sheet is not clear to me.

    You mean a cell on the sheet

    or

    you mean a sheetname

    or

    if a cell in a cell in a particular sheet is the same a a cell in another sheet.

    More info is needed.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Delete sheet by condition

    Hi, Birnen,

    donīt quote full posts please.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Delete sheet by condition

    this code is working, but not quite it.
    the word Hello is already in cell A1, and if someone delete the contents of cell A1. the macro should run automatically ...

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Delete sheet by condition

    Hi, Birnen,

    maybe this is what you are looking for (it will be triggered on any chage or edit in the range A1 on any worksheet). Code goes into ThisWorkbook:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Delete sheet by condition

    Thank you very much

    This working perfectly


    Best regards

    A special thank you to Hahobe.

+ 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. [SOLVED] Move row from one sheet to another based on condition and then delete - please help
    By junijl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2013, 10:32 AM
  2. [SOLVED] Delete Row If Condition
    By awcwa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2013, 06:39 PM
  3. delete cell if condition is met
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2010, 10:42 AM
  4. if condition and then delete row
    By plato in forum Excel General
    Replies: 4
    Last Post: 01-17-2010, 07:12 AM
  5. Delete Rows If condition not met
    By Pasha81 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-17-2009, 02:48 PM

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