+ Reply to Thread
Results 1 to 3 of 3

Deleting every row that does not contain the first date of the month

  1. #1
    Registered User
    Join Date
    06-16-2014
    Location
    Bergen
    MS-Off Ver
    2011
    Posts
    1

    Deleting every row that does not contain the first date of the month

    Hi

    I am doing financial calculations in Excel with stock prices found online, but most of the time I am not able to specify that I only want to download the stock price for the first day of every month, so I end up with daily stock prices (that means a lot of data when you work with 5-10 years). Of course, when saying "the first day of the month" I mean the first day when the Stock Exchange was open that month.

    So I download everything and start deleting every row where the date is not the first of that month for that year (very time consuming). So, I realized I could probably write a Macro to do the work for me, but I quickly learned that I am terrible at writing code. Does anyone have a Macro that could do this sort of work?

    Just to clarify, the Macro has to delete every row, but when the month changes that row is kept. In my case the date information is located in column A in the format dd.mm.yy.

    Thank you very much for your help!

    PS. I am aware that Yahoo Finance offers a list of monthly stock prices

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Deleting every row that does not contain the first date of the month

    Hi,

    Welcome to the forum

    Try this code:

    Please Login or Register  to view this content.
    Regards,
    Rudi

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Deleting every row that does not contain the first date of the month

    Another way for the fun
    Please Login or Register  to view this content.
    Last edited by PCI; 06-16-2014 at 04:33 PM.

+ 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. Sort month/date/year data using month and date only
    By SMW820 in forum Excel General
    Replies: 8
    Last Post: 11-18-2014, 08:39 AM
  2. Array function for date(month), Range Date(month)
    By dluhut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2013, 05:14 PM
  3. [SOLVED] Date arithmetic: adding 1 month to prior end of month date
    By manxman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-14-2006, 04:35 PM
  4. =VLOOKUP(1,Nationality!B5:B29,IF(MONTH(date)>6,MONTH(date)-6, MON
    By Ali in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-18-2006, 04:25 AM
  5. Determine begin month date from month end date.
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2006, 04:42 PM

Tags for this Thread

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