+ Reply to Thread
Results 1 to 7 of 7

VBA wich copies values when a cell changes

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    VBA wich copies values when a cell changes

    Hi,

    I'm writing a macro that's supposed to copy the values from a sourcecell into different destinationcells when a certain cell changes it's value. I've got the first part to work (when the particular cell's value changes, the macro copies the values from the sourcecell to the destination) however I don't want the destination cell to be constantly overwritten. When the sourcecell changes for the second time, I want that information to be copied to a cell beneath the first destinationcell.

    How can this be done?

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: VBA wich copies values when a cell changes

    if for example you have the following:

    Please Login or Register  to view this content.
    you can replace the pasting part with:

    Please Login or Register  to view this content.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA wich copies values when a cell changes

    In the Worksheet, something like this:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.


    Click on the appropriate worksheet from the Insert menu

    Type "Option Explicit" then paste the code under it

    and you're ready to go!
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    05-22-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: VBA wich copies values when a cell changes

    Thanks alot! This seems to work perfectly!

  5. #5
    Registered User
    Join Date
    05-22-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: VBA wich copies values when a cell changes

    If I want to copy a range of cells (in stead of just one value) that have changed to another location, how would I do that?

    Thanks again

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA wich copies values when a cell changes

    You're welcome!

    Maybe:

    Please Login or Register  to view this content.
    Last edited by xladept; 06-16-2013 at 03:30 PM.

  7. #7
    Registered User
    Join Date
    09-12-2013
    Location
    Dub, Irl
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VBA wich copies values when a cell changes

    Quote Originally Posted by SRA View Post
    Hi,

    I'm writing a macro that's supposed to copy the values from a sourcecell into different destinationcells when a certain cell changes it's value. I've got the first part to work (when the particular cell's value changes, the macro copies the values from the sourcecell to the destination) however I don't want the destination cell to be constantly overwritten. When the sourcecell changes for the second time, I want that information to be copied to a cell beneath the first destinationcell.

    How can this be done?

    Thanks!
    Hey Man,

    I'm trying to do the same as yourself. I was wondering could you please post the code that you used and got working.

    Thanks in Advance!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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