+ Reply to Thread
Results 1 to 4 of 4

VBA Code To Mirror Cells from one Worksheet to another

  1. #1
    Registered User
    Join Date
    03-03-2010
    Location
    Oxfordshire
    MS-Off Ver
    Excel 2007
    Posts
    19

    VBA Code To Mirror Cells from one Worksheet to another

    I am quite new to this forum so I apologise if I do something incorrectly.

    I need to mirror individual cells from one worksheet to a multiple of other worksheets within the same work book. I was wondering if anyone had written a code that could do this that I could copy and paste in and edit to fit this document.

    I have had a reasonable look through the forum for this answer but cant seem to find one that fits.

    Thank-you,

    Daniel1234
    Last edited by Daniel1234; 03-05-2010 at 07:06 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA Code To Mirror Cells from one Worksheet to another

    This is a fairly simple-minded version but works:
    Please Login or Register  to view this content.
    This code must go in the code for the worksheet that is the source of the data. I took you literally when you said "mirror"--this puts values in the same cell in the destination that is used in the source.

    Further, this code will copy all of the values of interest every time there is any change anywhere on the source sheet, even if the change is not one of the values to be copied. It is not difficult to make that more efficient but I didn't want to write a lot more code without knowing the specifics of your situation.

    (Also, note that you posted to the Excel General forum, but are asking about VBA code. There is a forum specifically for that called Excel Programming.)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-03-2010
    Location
    Oxfordshire
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: VBA Code To Mirror Cells from one Worksheet to another

    When i pop it into the view code section i get this error

    Run Time error '9'
    Subscript out of Range

    if i click on debug this line is highlighted in yellow


    Worksheets(wsName).Range("A1") = Range("A1")

    (Sorry for posting in the wrong section will make sure it doesnt happen again)

    Thanks,

    Daniel1234

  4. #4
    Registered User
    Join Date
    03-03-2010
    Location
    Oxfordshire
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: VBA Code To Mirror Cells from one Worksheet to another

    Hi sorry have worked out where i went wrong i needed to put a space inbetween sheet and 1 works like a charm thankyou so much

    Daniel1234

+ 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