+ Reply to Thread
Results 1 to 2 of 2

Looking for VBA code to stop data updating using today's date.

  1. #1
    Registered User
    Join Date
    10-08-2014
    Location
    Houston, Texas
    MS-Off Ver
    MS 2010
    Posts
    4

    Post Looking for VBA code to stop data updating using today's date.

    Hello Good People,

    I am new to VBA and working on one of my spreadsheet that I update weekly. I have the dates from 1/1/2015 to 12/31/2015 and the data are from "K37:BN401". I wanted to write a code so that the data update will stop at "Today's" date any day I open the spreadsheet to update. I have a code below which tend to update the data to today's date but also have the last value for today copied through to the end of the year. Please any help will be greatly appreciated. Thanks all. Below is my current code:
    Sub Update_WeeklyReport()

    Dim myArray() As Variant
    myArray = Worksheets("Sheet1").Range("K37:BN401").Value


    With Sheets(1).Range("A4")
    .Value = Date
    .NumberFormat = "mm/dd/yy"

    End With

    Dim LastRow As Long

    LastRow = Cells(Cells.Rows.Count, "K").End(xlUp).Row
    Range("K37:BN" & LastRow).FillDown


    End Sub

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Looking for VBA code to stop data updating using today's date.

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Ben Van Johnson

+ 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. Replies: 5
    Last Post: 09-09-2014, 10:57 PM
  2. If statement - Need to stop the today's date calculation
    By crw reef in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2014, 02:57 PM
  3. Help with automatic chart updating/auto updating today function
    By Tux2424 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-26-2012, 04:45 PM
  4. Stop cell from updating when a date is reached
    By acampbeb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2012, 08:27 AM
  5. [SOLVED] Code to auto filter three month segments of data from today's date
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2012, 04:51 PM
  6. [SOLVED] How do I stop a date from automatically updating?
    By Canwoman88 in forum Excel General
    Replies: 5
    Last Post: 01-09-2006, 03:15 PM
  7. Replies: 2
    Last Post: 01-03-2005, 09:06 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