+ Reply to Thread
Results 1 to 6 of 6

Creating an Event Change that will copy paste cells from a different sheet

  1. #1
    Registered User
    Join Date
    06-19-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    4

    Creating an Event Change that will copy paste cells from a different sheet

    Hello,

    I need help with writing a VBA code that will allow me to copy the cells in the range D7:D12 in the Sheet named DefaultData and paste them into the cells L41:L46 of the sheet called AD, when the cell H7 in the INPUTS sheet has the text "Farm Manure"

    So far this is the code I have,

    Please Login or Register  to view this content.
    But it is not working
    Please help me!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Creating an Event Change that will copy paste cells from a different sheet


    Hi !

    first, your event code must be located within the source data worksheet module …

  3. #3
    Registered User
    Join Date
    06-19-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    4

    Re: Creating an Event Change that will copy paste cells from a different sheet

    Yeah that's where I have it, as a Module in the Sheet I need it to run in

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Creating an Event Change that will copy paste cells from a different sheet


    Second, what is this source worksheet and what is its range address to watch out for any change ?

  5. #5
    Registered User
    Join Date
    06-19-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    4

    Re: Creating an Event Change that will copy paste cells from a different sheet

    the source worksheet is called DefaultData and the range to watch out is H7 in a sheet called INPUTS

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool


    Paste this code event to the worksheet INPUTS module :

    PHP Code: 
    Private Sub Worksheet_Change(ByVal Target As Range)
        If 
    Target.Address "$H$7" Then
            
    If Target.Value "Farm Manure" Then Range("DefaultData!D7:D12").Copy Range("AD!L41:L46")
        
    End If
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

+ 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. Event Change code to copy paste cells based on the text of a cell
    By ds9703c in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2018, 01:21 PM
  2. [SOLVED] Worksheet Change Event Is very Slow To work copy formula and paste
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2017, 07:12 AM
  3. Worksheet change event copy paste dont call a macro
    By ricklou in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2017, 04:26 PM
  4. copy a range of cells N times and paste in separate sheet and also change a specific colum
    By maramkarthik in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2013, 04:27 AM
  5. need worksheet change event to fire when pasting; for all cells in paste range
    By ShoshanaM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 10:10 AM
  6. Event change copy paste
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2010, 03:09 PM
  7. Change event copy & paste
    By Mr. Dan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2006, 05:50 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