Consulting

Results 1 to 5 of 5

Thread: Solved: Duplicate cells across sheets upon update

  1. #1
    VBAX Regular belly0fdesir's Avatar
    Joined
    Jan 2006
    Location
    Inland Empire
    Posts
    36
    Location

    Solved: Duplicate cells across sheets upon update

    A question of mine, similar to this one was x-posted here.


    I have a sheet called Summary and anytime there is a change in cells 'Summary!B6:B120', I want the change to be replicated in Jan:Dec!B7:B121. Also, any time there is a change in Summary!F6:F120 I want it to be replicated in Jan:Dec!M7:M121.

    Column B is a list of names. So my goal is to have any name changed or added to the list in Summary appear in the list in Jan:Dec. Column F is department, which is also shown in Jan:Dec!M7:M121 and I would like it to react in the same manner.

    Does this make sense to anyone? Does anyone know of a method I could use to accomplish my goal? Thank you to anyone who considers giving me help.

  2. #2
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Are those the only instances and only requirements, if it changes that that cell goes to the corresponding area (but 1 row down)?

    This doesn't sound to harsh...if no one else jumps in, I can zip this out later on...Unfortuanately, I have other business to attend to for a couple of hours...will check back to see if any one else got you what you needed...
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  3. #3
    VBAX Regular belly0fdesir's Avatar
    Joined
    Jan 2006
    Location
    Inland Empire
    Posts
    36
    Location
    That is correct for Column B. Any change made in Column B of Summary should also occur in Jan:Dec Column B, one cell down.

    Any change in Column F should change Jan:Dec Column M, one cell down. (and I guess 7 columns to the right).

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Here's some code as in the attached example. You'll need to add the rest of the months.

    [VBA]
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Sh, s
    Dim Tgt As String
    Sh = Array("Jan", "Feb", "Mar") 'etc.

    If Not Intersect(Target, Range("B6:B120")) Is Nothing Then
    Tgt = Target.Offset(1).Address
    For Each s In Sh
    Sheets(s).Range(Tgt) = Target
    Next
    End If

    If Not Intersect(Target, Range("F6:F120")) Is Nothing Then
    Tgt = Target.Offset(1, 7).Address
    For Each s In Sh
    Sheets(s).Range(Tgt) = Target
    Next
    End If
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Regular belly0fdesir's Avatar
    Joined
    Jan 2006
    Location
    Inland Empire
    Posts
    36
    Location
    Worked perfectly. Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •