Posts by scttsmn

    Re: Identifying a variety of holidays in a data set

    I found a solution that will work for me - I did not use the code from my original post. Below is an excerpt of the coding from my Macro (granted, all the variables are not defined in this excerpt). I embedded an IsDate function in an IF statement, to verify that the cell value was a date - if the value is not a date, then the "LSearchRowMod = LSearchRowMod + 1" portion moves the search to the next line. If a date is found and it matches the "month" and "day" criteria, then it is copied into Sheet2. I can then replicate this code for each date that I want to search.

    Thank you again for your help.

    Re: Identifying a variety of holidays in a data set

    Thank you for your quick response!

    This is certainly one way of accomplishing the task, however, I would rather not hard code absolute dates into the macro if I don't have to. I would like to set up the macro to identify "December 25" in ANY year (not just 2015). Could this existing code be modified to achieve this task? The more advanced application would be that I would use the macro to identify a variety of dates (in any year).

    Thank you again!

    While searching the internet, I came across the following code, which searches a data set for the macro-defined search terms, and copies them into a separate workbook. This code works splendidly, however, I would like to modify it to search for certain holidays. However, I have never worked with these types of date-defining/constricting codes before. In a simple example, how might I modify this code to search for January 1, December 24, and December 25... instead of Fruit 2, Fruit 5, and Fruit 18?

    Thank you in advance for your help!

    Re: Macro to replicate the naming convention of adding a new worksheet

    Thanks Bruce! This worked like a charm! I added a couple lines to force the new sheet to the right of the original sheet!

    Thanks again!

    I am trying to write a macro in which the macro will insert a new worksheet similar to how a new sheet would normally be added. The difference, however, is that I would like the name of the new sheet to be "Results" and follow the naming convention that is standard for new sheets (Results1, Results2, Results3.... so on an so forth) so that each time the macro is run, a new sheet will be generated.

    I am familiar with the coding to insert a new sheet, but how do I get the macro to search the existing sheets' names to find the "Results#" tab with the largest number, and then follow the naming convention for the next new tab?

    Thank you for your help.