Results 1 to 5 of 5

VBA to enter date range based on date range in above cell

Threaded View

  1. #1
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    VBA to enter date range based on date range in above cell

    Hi All,
    I was wondering if it is possible to have my macro also enter the next dange range when it inserts a new cell range.
    It is currently called in the worksheet module when cell A1 is selected:

    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
        If Target.Address = "$A$1" Then
            Call Refresher
        End If
    End Sub
    Which executes the macro:

    Sub Refresher()
    
    Range("A2:D2").Select
        Selection.Copy
        Range("T3").Select
        Selection.Insert Shift:=xlDown
        Range("A3:D31").Select
        Application.CutCopyMode = False
        Selection.Copy
        ActiveWindow.SmallScroll Down:=-9
        Range("A2:D31").Select
        ActiveSheet.Paste
        Range("A31:D31").Select
        Application.CutCopyMode = False
        Selection.ClearContents
    End Sub
    With the logic here being to copy the first row of data then paste it off the viewing area (in this case column T) for historical data, then to move the data up one row then clear the contents of the bottom row.
    I also would like the next work weeks date range (Monday through Friday) to be inserted in Range A31:D31 regardless of what the actual date is. This data feeds a rolling 30 week trend chart.

    Any help would be greatly appreciated, thanks!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Enter Value of cell within a date range
    By keithnrhonda in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-21-2013, 12:34 PM
  2. [SOLVED] Date Filter based on Cell Input - single date or range of dates
    By babaloo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2012, 10:32 AM
  3. Max, Min date range based on another cell range
    By va_san in forum Excel General
    Replies: 2
    Last Post: 06-18-2010, 01:46 PM
  4. copy date based on date -refer to date range
    By mindpeace in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2006, 08:35 AM
  5. How do I enter a date range ie -7 from current date in MS QUERY
    By notsmartenough in forum Excel General
    Replies: 1
    Last Post: 11-11-2005, 06:25 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