Results 1 to 9 of 9

Copy a row record to a sheet based on the date entered in to a cell

Threaded View

Gary Stunell Copy a row record to a sheet... 05-27-2016, 04:51 AM
jayherring86 Re: Copy a row record to a... 05-27-2016, 08:42 AM
Gary Stunell Re: Copy a row record to a... 05-27-2016, 09:18 AM
jayherring86 Re: Copy a row record to a... 05-27-2016, 09:59 AM
jayherring86 Re: Copy a row record to a... 05-27-2016, 10:01 AM
Gary Stunell Re: Copy a row record to a... 05-31-2016, 09:41 AM
jayherring86 Im thrilled that it worked! ... 05-31-2016, 09:44 AM
Gary Stunell Re: Copy a row record to a... 06-02-2016, 05:23 AM
jayherring86 Re: Copy a row record to a... 05-27-2016, 10:11 AM
  1. #4
    Forum Contributor
    Join Date
    08-23-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Copy a row record to a sheet based on the date entered in to a cell

    Hello, sorry this reply took so long... i'm still learning about excel code myself so it took me a while to work out all the bugs.

    I believe this will work for you but i stress that you really should save and backup your work, and use a test sheet beforehand because you may ned to alter the code slightly!

    you should paste this into the "microsoft excel objects" area for the main sheet:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
        Dim strMonth As String
        Dim rngToCopy As Range
        Dim rngToPaste As Range
        
        'this IF will activate only cells in Column C,D, or E when the cell value changes and enter is pressed
        If Target.Address = Range("C" & Target.Row).Address Or Target.Address = Range("D" & Target.Row).Address Or Target.Address = Range("E" & Target.Row).Address Then
        
        'this strMonth turns the value entered into a Month name eg "January"
         strMonth = Format(Target, "mmmm")
        
        
        'define the Rows of information to copy and paste
        Set rngToCopy = Sheets(1).Range(Rows(Target.Row).Address)
        Set rngToPaste = Sheets(strMonth).Range(Rows(Sheets(strMonth).Cells(23000, 1).End(xlUp).Row).Address)
    
            'use the Month name to determine the worksheet to use
            
                rngToCopy.EntireRow.Copy Destination:=rngToPaste.Offset(1)
    
        Else: Exit Sub
        
        End If
    
    End Sub
    Last edited by jayherring86; 05-27-2016 at 10:18 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy,Cut, Paste Row to different sheet when date entered becomes todays date - Please Help
    By Mykull in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2016, 01:55 PM
  2. [SOLVED] Copy Paste a Range of Values from a Different Sheet Based on Value Entered in Cell
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-13-2015, 04:53 PM
  3. Replies: 0
    Last Post: 11-25-2014, 05:30 PM
  4. [SOLVED] Insert Row and Record in Another Sheet Once I entered date
    By atulexel79 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-22-2014, 10:04 AM
  5. VBA for copy record to sellected 2 sheet & clear entry sheet for new record
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-24-2012, 10:54 PM
  6. Cell formula to record many values and date entered
    By Stryda in forum Excel General
    Replies: 11
    Last Post: 11-13-2011, 04:28 PM
  7. [SOLVED] recording the date when record was entered in cell in Excel
    By mcgoo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-10-2005, 07: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