+ Reply to Thread
Results 1 to 15 of 15

Linking Rows Together When Cells Can Change

  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Linking Rows Together When Cells Can Change

    Hi all,

    I'm stuck again with my spreadsheet, it's really turning into a monster!

    I have a sheet called ACW, that keeps 52 weeks of a value. This sheet gets the name of the people from a sheet called Team. What I would like is that when names are added to Team, that the sheet can either be manually sorted to A-Z or automatically changed. I have sorted this bit out however when I sort the names, the values are not linked in ACW so they do not move.

    Is there anyway to fix this?

    Thanks in advance, I really appreciate any help
    Attached Files Attached Files
    Last edited by Fossii; 03-04-2011 at 07:07 AM. Reason: Adding Attachment

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Linking Rows Together When Cells Can Change

    Can you explain your problem further?

    The sheet seems to do what you are asking for.

    What am I missing?

  3. #3
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    Hi, the problem is, when I change the order of names, the values in the Week columns in ACW don't.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Linking Rows Together When Cells Can Change

    I'm assuming then that you mean the values in Week 1 in your sample.

    Running your macro fails because Sheet "Cumulative" is missing, post a sample that has this sheet and I'll look at it again.
    It seems to me that you might need to trigger this macro in the sheet change event, but until I see it run successfully I can't be sure about what it does.

  5. #5
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    Hi, I've not had a cumulative post in quite a while, I changed this to Summary which is included in the attached workbook.

    Honestly not sure where the Macro is from, I'm just starting to learn about Macros
    Attached Files Attached Files

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Linking Rows Together When Cells Can Change

    I'm having broadband connection issues, BT b*****ing about again, I'll get back to you as soon as I can get a connection long enough to download your new file.

    Bear with me unless someone else helps.

  7. #7
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    Thanks Marcol

  8. #8
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    Hello, can anyone help with this please? I've been trying buy still can't figure out how to do it!

  9. #9
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    Hi, I know I haven't given enough information so I've added a bit more, please ignore any Macro in the example sheets as that was my failed attempt at trying to make one

    Team Worksheet

    First Name Surname
    Alan A
    Brian B

    ACW Worksheet

    First Name Surname Value
    Alan A 1
    Brian B 2

    When I change the order of “Surname” in “Team”, this changes the order in “ACW” however not the value on the same row as the values so I end up with something like below.

    First Name Surname Value
    Brian B 1
    Alan A 2

    Is it possible to change this so that when I change the order of “Surname” in “Team” that it would show like below?

    First Name Surname Value
    Brian B 2
    Alan A 1

    Thanks, I'm sorry I didn't give enough information previously!

  10. #10
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Linking Rows Together When Cells Can Change

    I assume you need to sort a range automatically, then use the following User defined function
    or your refer to your file with changes made
    Function SORTDATA(x As Range) As Variant
    Dim n As Integer
    n = x.Rows.Count
    sortarray = x
    Do
    sortstop = True
    For i = 1 To n - 1
    If UCase(sortarray(i, 1)) > UCase(sortarray(i + 1, 1)) Then
    sortstop = False
    Temp = sortarray(i, 1)
    sortarray(i, 1) = sortarray(i + 1, 1)
    sortarray(i + 1, 1) = Temp
    End If
    Next i
    Loop While Not (sortstop)
    SORTDATA = sortarray
    End Function

  11. #11
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Linking Rows Together When Cells Can Change

    Sorry, attachemet missed in the previous post
    Attached Files Attached Files

  12. #12
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Linking Rows Together When Cells Can Change

    I've looked at this several times and am still struggling to understand how the sheet is meant to work.

    I see what you are trying to do, I think, but I'm at a loss as to how you see it finally needed to work.

    What are the figures in ACW Week Nos based on? How are they associated with the employees' name?

    If you could explain this then it should be possible to do what you need without macros, or a least reduce them to change events.

    Your problem should not be difficult, it's just a question of seeing it clearly.

    Cheers

  13. #13
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    The ACW Week Nos are based on After Call Work. Each Employee has 52 weeks where this is recorded. The problem I have is I can sort the names on the Team sheet and this changes the order of the names on the ACW sheet, however, the ACW values for each advisor does not change

    As you can see from the example above, when I change the order from A-Z to Z-A, Brian B now has Alan A's Stat, the values do not change order with the names.

    I'm not really sure how to explain it any other way to be honest!

    Thanks,

  14. #14
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Linking Rows Together When Cells Can Change

    Okay, give this a try.

    We will need to do a bit more with this workbook, but try sorting your table on Sheet Teams, say in reverse order, then go to Sheet ACW it will take a while to change but this is fixable, at present it reads back and forth from VBa to Excel, a few more arrays will cure that.

    We will need a few more bits to handle changes in Sheet Teams and new tables where there is no data in ACW etc

    The macro is triggered by the Sheet ACW sheet activate event, this might not be the best way I'm still trying to figure out what you are ultimately aiming at.

    I am not sure why you have data in ACW when there is no associated name, Rows 26 to 31. (I have added a row to this sheet to align with Teams, this makes coding a bit easier.)

    [EDIT]
    Attachment updated before OP returned
    Attached Files Attached Files
    Last edited by Marcol; 03-14-2011 at 03:04 PM. Reason: Updated attachment
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  15. #15
    Registered User
    Join Date
    01-28-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Linking Rows Together When Cells Can Change

    Sorry for the late reply. That works great, thanks!

    I do have a wee issue with doing the same thing to the summary screen. It removes the formulas in Summary when run.

    Could you have a wee look and tell me what's wrong?

    For Summary!D7
    =INDEX(ACW!$D$6:$BC$24, MATCH($B7&"-"&$C7, INDEX(ACW!$B$6:$B$34&"-"&ACW!$C$6:$C$34, 0), 0), $C$3)
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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