+ Reply to Thread
Results 1 to 2 of 2

perpetual dates

  1. #1
    willray
    Guest

    perpetual dates

    Is there a way to have excel automatically add a new date to the end of a
    column each day? My goal is to have an automatic date in column A and daily
    closing prices for the S&P500(in column B) corresponding to those dates that
    are updated via web query. Thanks so much!

  2. #2
    Dave Peterson
    Guest

    Re: perpetual dates

    Maybe...

    Option Explicit
    Sub auto_open()
    Dim LastCell As Range
    With Worksheets("Sheet1")
    Set LastCell = .Cells(.Rows.Count, "A").End(xlUp)
    If LastCell.Value = Date Then
    'already opened and populated
    'do nothing
    Else
    With LastCell.Offset(1, 0)
    .Value = Date
    .NumberFormat = "mm/dd/yyyy"
    End With
    End If
    End With
    End Sub

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    (I have no idea about the query, though.)

    willray wrote:
    >
    > Is there a way to have excel automatically add a new date to the end of a
    > column each day? My goal is to have an automatic date in column A and daily
    > closing prices for the S&P500(in column B) corresponding to those dates that
    > are updated via web query. Thanks so much!


    --

    Dave Peterson

+ 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