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_PEIT()
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
Bookmarks