+ Reply to Thread
Results 1 to 4 of 4

How do a delete rows with specific months

  1. #1
    Registered User
    Join Date
    04-04-2014
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2010
    Posts
    32

    How do a delete rows with specific months

    I want to delete rows that have dates of February, March, May, June, August, September, November and December.

    12/12/1980
    1/2/1981
    2/2/1981
    3/2/1981
    4/1/1981
    5/1/1981
    6/1/1981
    7/1/1981
    8/3/1981
    9/1/1981
    10/1/1981
    11/2/1981
    12/1/1981
    1/4/1982
    2/1/1982
    3/1/1982
    4/1/1982
    5/3/1982
    6/1/1982

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: How do a delete rows with specific months

    Try this vba solution:

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How do a delete rows with specific months

    Or if you prefer to use formula

    in B2 and copy down

    =TEXT(A2,"mmm")

    then apply filter to columns A and B select months that you want, next, highlight selected rows, right click and delete.

    A
    B
    1
    Date Month
    2
    12/12/1980
    Dec
    3
    1/2/1981
    Jan
    4
    2/2/1981
    Feb
    5
    3/2/1981
    Mar
    6
    4/1/1981
    Apr
    7
    5/1/1981
    May
    8
    6/1/1981
    Jun
    9
    7/1/1981
    Jul
    10
    8/3/1981
    Aug
    11
    9/1/1981
    Sep
    12
    10/1/1981
    Oct
    13
    11/2/1981
    Nov
    14
    12/1/1981
    Dec
    15
    1/4/1982
    Jan
    16
    2/1/1982
    Feb
    17
    3/1/1982
    Mar
    18
    4/1/1982
    Apr
    19
    5/3/1982
    May
    20
    6/1/1982
    Jun
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How do a delete rows with specific months

    Or you could skip the helper, and still use the suggested Filter, you would just need to pick out the month from each year
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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 rows that do no contain a specific word
    By Tesseh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2014, 02:08 AM
  2. [SOLVED] Delete rows fi specific text
    By blue.chio in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2013, 02:23 PM
  3. [SOLVED] Delete Specific Rows
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2011, 10:00 AM
  4. Delete rows for specific range
    By georgeanaprop in forum Excel General
    Replies: 2
    Last Post: 12-04-2009, 04:22 AM
  5. Delete rows without a specific value
    By chriss in forum Excel General
    Replies: 3
    Last Post: 06-02-2008, 12:27 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