Trouble highlighting row data.

Davio

New Member
Joined
Jun 10, 2014
Messages
36
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]TABLE1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]U[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]R[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD]TEAM1[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]TEAM2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]TEAM3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]TABLE2[/TD]
[TD="align: center"]TASK[/TD]
[TD="align: center"]START DATE[/TD]
[TD="align: center"]END DATE[/TD]
[/TR]
[TR]
[TD]TEAM1[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]1jan[/TD]
[TD="align: center"]3jan[/TD]
[/TR]
[TR]
[TD]TEAM2[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]3jan[/TD]
[TD="align: center"]7jan[/TD]
[/TR]
[TR]
[TD]TEAM3[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]9jan[/TD]
[TD="align: center"]10jan[/TD]
[/TR]
[TR]
[TD]TEAM1[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]7jan[/TD]
[TD="align: center"]8jan[/TD]
[/TR]
</tbody>[/TABLE]
I am having issues with TABLE1 highlighting the start and end dates from TABLE2. My goal is to have the data from TABLE2 visualized in TABLE1 The task data does not factor in to the visualization represented in TABLE1. any help or advice is appreciated.

Thank you.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBY
1
2SunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFri
31-Sep-192-Sep-193-Sep-194-Sep-195-Sep-196-Sep-197-Sep-198-Sep-199-Sep-1910-Sep-1911-Sep-1912-Sep-1913-Sep-1914-Sep-1915-Sep-1916-Sep-1917-Sep-1918-Sep-1919-Sep-1920-Sep-1921-Sep-1922-Sep-1923-Sep-1924-Sep-1925-Sep-1926-Sep-1927-Sep-1928-Sep-1929-Sep-1930-Sep-191-Oct-192-Oct-193-Oct-194-Oct-195-Oct-196-Oct-197-Oct-198-Oct-199-Oct-1910-Oct-1911-Oct-1912-Oct-1913-Oct-1914-Oct-1915-Oct-1916-Oct-1917-Oct-1918-Oct-1919-Oct-1920-Oct-1921-Oct-1922-Oct-1923-Oct-1924-Oct-1925-Oct-1926-Oct-1927-Oct-1928-Oct-1929-Oct-1930-Oct-1931-Oct-191-Nov-192-Nov-193-Nov-194-Nov-195-Nov-196-Nov-197-Nov-198-Nov-199-Nov-1910-Nov-1911-Nov-1912-Nov-1913-Nov-1914-Nov-1915-Nov-19
4TEAM1
5TEAM2
6TEAM3
7TEAM4
8TEAM5
9TEAM6
10MISC EVENTS
11Report PeriodSep-19Oct-19Nov-19
12
13
14
15
16
17
18TEAMPROJECTSTART DATEEND DATE
19TEAM1CROSSFIT3-Sep-1910-Oct-19
20TEAM2STRENGTH TNG10-Sep-1915-Oct-19
21TEAM3CARDIO1-Oct-1920-Oct-19
22TEAM4NUTRITION30-Oct-1910-Nov-19
23TEAM510-Nov-1912-Nov-19
24TEAM615-Nov-1919-Nov-19
25MISC EVENTS10-Sep-193-Nov-19
26
27
28
29
30
31
32
33
TRAINING



Peter,

Looking at the tracker, I think it will be better if I have the "projects" displayed across the date range. I have no experience with vba or macros. Where do I begin?
 
Upvote 0
Looking at the tracker, I think it will be better if I have the "projects" displayed across the date range. I have no experience with vba or macros. Where do I begin?
For the layout you have just posted, try this in a copy of the workbook. It is a Worksheet_Change event code which means it is triggered when you change anything on the worksheet. It looks (or should) to see if anything was changed in that bottom section (below the 'Team Name' heading in A18) & if so rebuilds the top tracker section. To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test. (To start with copy the bottom section and re-paste it to trigger the code. Then try adding/deleting/altering dates, team names Projects etc)
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

The colours that get applied to each team are determined by the 'Const' line near the start of the code and the choice of colours can be seen here

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim Changed As Range, rw As Range, cellTeam As Range, rAnchorDate As Range, rTracker As Range, rData As Range
  Dim rwTeam As Long, NumDays As Long, TeamClr As Long, AnchorDate As Long, AnchorCol As Long, StartDateCol As Long, oSet As Long, lc As Long
  Dim TeamName As String
  Dim aColours As Variant
  
  Const TeamColours As String = "$Team1:50|$TEAM2:4|$Team3:33|$TEAM4:6|$TEAM5:22|$Team6:45|$Misc Events:35" '<- Adjust team names and colour values here

  Set rData = Columns("A").Find(What:="Team Name", LookAt:=xlWhole, SearchDirection:=xlPrevious, MatchCase:=False).Offset(1)
  Set rData = rData.Resize(Cells.SpecialCells(xlCellTypeLastCell).Row - rData.Row + 1, 7)
  Set Changed = Intersect(Target, rData)
  If Not Changed Is Nothing Then
    Application.EnableEvents = False
    On Error GoTo AEET
    lc = Cells(3, Columns.Count).End(xlToLeft).Column
    Set rTracker = Range("B4").Resize(Columns("A").Find(What:="Report Period", LookIn:=xlValues, LookAt:=xlWhole, SearchDirection:=xlPrevious, MatchCase:=False).Row - 4, lc - 1)
    Set rAnchorDate = rTracker.Cells(0, 1)
    AnchorDate = rAnchorDate.Value
    AnchorCol = rAnchorDate.Column
    aColours = Split(TeamColours, "|")
    With rTracker
      .ClearContents
      .Interior.ColorIndex = xlNone
      .HorizontalAlignment = xlGeneral
    End With
    For Each rw In rData.Rows
      TeamName = rw.Cells(1).Value
      If Len(TeamName) > 0 Then
        Set cellTeam = Range("A4:A17").Find(What:=TeamName, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
        If Not cellTeam Is Nothing Then
          rwTeam = cellTeam.Row
          
          NumDays = rw.Cells(7).Value - rw.Cells(6).Value + 1
          oSet = rw.Cells(6).Value - AnchorDate
          StartDateCol = AnchorCol + oSet
          With Cells(rwTeam, StartDateCol).Resize(, NumDays)
            .Cells(1).Value = rw.Cells(2).Value
            .HorizontalAlignment = xlCenterAcrossSelection
            If InStr(1, TeamColours, "$" & TeamName & ":", vbTextCompare) > 0 Then
               TeamClr = Split(Mid(TeamColours, InStr(1, TeamColours, "$" & TeamName & ":", vbTextCompare) + Len(TeamName) + 2), "|")(0)
               .Interior.ColorIndex = TeamClr
            End If
          End With
        End If
      End If
    Next rw
  End If
AEET:
  Application.EnableEvents = True
End Sub

Here is part of my sheet after I have entered my data at the bottom. Note that I have changed that data so you can see the results in a screen shot that is not too large.

Excel Workbook
ABCDEFGHIJKLMNOPQ
301-Sep-1902-Sep-1903-Sep-1904-Sep-1905-Sep-1906-Sep-1907-Sep-1908-Sep-1909-Sep-1910-Sep-1911-Sep-1912-Sep-1913-Sep-1914-Sep-1915-Sep-1916-Sep-19
4TEAM1CROSSFIT
5TEAM2STRENGTH TNG
6TEAM3CARDIONUTRITION
7TEAM4
8TEAM5
9TEAM6Other 1
10MISC EVENTSOther 2
11Report Period
12
16
17
18Team NameProjectSTART DATEEND DATE
19TEAM1CROSSFIT1-Sep8-Sep
20TEAM2STRENGTH TNG10-Sep15-Sep
21TEAM3CARDIO2-Sep5-Sep
22TEAM3NUTRITION9-Sep15-Sep
23TEAM44-Sep7-Sep
24TEAM6Other 17-Sep16-Sep
25MISC EVENTSOther 210-Sep10-Sep
26
Tables (wsc1)
 
Last edited:
Upvote 0
After following the instructions, there are no changes.

Disregard,

It works perfectly. Thank you
 
Last edited:
Upvote 0
Peter,

I am trying to update the spreadsheet to compile all information to display the ranges on a summary page.

So far, I've made duplicate sheets with different tab (Name A, Name B, Name C, Name D, Name E, Name F, Name G) names. Now I want only the calendar section from each sheet (tab) to display into one summary calendar. I have adjusted some of the team names to reflect which tab they are pulled from.
 
Upvote 0
Peter,

I am trying to update the spreadsheet to compile all information to display the ranges on a summary page.

So far, I've made duplicate sheets with different tab (Name A, Name B, Name C, Name D, Name E, Name F, Name G) names. Now I want only the calendar section from each sheet (tab) to display into one summary calendar. I have adjusted some of the team names to reflect which tab they are pulled from.
Sorry, I don't understand exactly what your setup & requirement is. Perhaps you could post some very small examples & results to help demonstrate?
 
Upvote 0
ABCDEFGHIJKLMNOP

<tbody>
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: right"]Sun[/TD]
[TD="align: right"]Mon[/TD]
[TD="align: right"]Tue[/TD]
[TD="align: right"]Wed[/TD]
[TD="align: right"]Thu[/TD]
[TD="align: right"]Fri[/TD]
[TD="align: right"]Sat[/TD]
[TD="align: right"]Sun[/TD]
[TD="align: right"]Mon[/TD]
[TD="align: right"]Tue[/TD]
[TD="align: right"]Wed[/TD]
[TD="align: right"]Thu[/TD]
[TD="align: right"]Fri[/TD]
[TD="align: right"]Sat[/TD]
[TD="align: right"]Sun[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1-Sep-19[/TD]
[TD="align: center"]2-Sep-19[/TD]
[TD="align: center"]3-Sep-19[/TD]
[TD="align: center"]4-Sep-19[/TD]
[TD="align: center"]5-Sep-19[/TD]
[TD="align: center"]6-Sep-19[/TD]
[TD="align: center"]7-Sep-19[/TD]
[TD="align: center"]8-Sep-19[/TD]
[TD="align: center"]9-Sep-19[/TD]
[TD="align: center"]10-Sep-19[/TD]
[TD="align: center"]11-Sep-19[/TD]
[TD="align: center"]12-Sep-19[/TD]
[TD="align: center"]13-Sep-19[/TD]
[TD="align: center"]14-Sep-19[/TD]
[TD="align: center"]15-Sep-19[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]TEAM-1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="bgcolor: #339966"]STRENGTH[/TD]
[TD="bgcolor: #339966"][/TD]
[TD="bgcolor: #339966"][/TD]
[TD="bgcolor: #339966"][/TD]
[TD="bgcolor: #339966"][/TD]
[TD="bgcolor: #339966"][/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]TEAM-2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]TEAM-3[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]TEAM-4[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="bgcolor: #FFFF00"]VACATION-VACANT[/TD]
[TD="bgcolor: #FFFF00"][/TD]
[TD="bgcolor: #FFFF00"][/TD]
[TD="bgcolor: #FFFF00"][/TD]
[TD="bgcolor: #FFFF00"][/TD]
[TD="bgcolor: #FFFF00"][/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]TEAM-5[/TD]
[TD="bgcolor: #FF8080"]NO TRAINER AVAILABLE[/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]
[TD="bgcolor: #FF8080"][/TD]

[TD="align: center"]9[/TD]
[TD="align: center"]MISC EVENTS[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]
[TD="align: center"]Report Period[/TD]
[TD="align: center"]Sep-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]11[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]12[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]16[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]17[/TD]
[TD="align: center"]TEAM NAME[/TD]
[TD="align: center"]TRAINING[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]START[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]END[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]18[/TD]
[TD="align: center"]TEAM-1[/TD]
[TD="align: center"]STRENGTH[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]10-Sep-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]20-Sep-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]19[/TD]
[TD="align: center"]TEAM-2[/TD]
[TD="align: center"]CARDIO[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]25-Sep-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]2-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]20[/TD]
[TD="align: center"]TEAM-3[/TD]
[TD="align: center"]ENDURANCE[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]7-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]15-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]21[/TD]
[TD="align: center"]TEAM-4[/TD]
[TD="align: center"]VACATION-VACANT[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]10-Sep-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]10-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]22[/TD]
[TD="align: center"]TEAM-5[/TD]
[TD="align: center"]NO TRAINER AVAILABLE[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]1-Sep-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]22-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]23[/TD]
[TD="align: center"]MISC EVENTS[/TD]
[TD="align: center"]HALLOWEEN SPECIAL[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]25-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]31-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]24[/TD]
[TD="align: center"]TEAM-1[/TD]
[TD="align: center"]ENDURANCE[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]7-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]15-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]25[/TD]
[TD="align: center"]TEAM-2[/TD]
[TD="align: center"]STRENGTH[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]19-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]29-Oct-19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
TABLE 1 TAB (NAME A)



VBA Code 1
-----------------------------------------------------------------

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Changed As Range, rw As Range, cellTeam As Range, rAnchorDate As Range, rTracker As Range, rData As Range
Dim rwTeam As Long, NumDays As Long, TeamClr As Long, AnchorDate As Long, AnchorCol As Long, StartDateCol As Long, oSet As Long, lc As Long
Dim TeamName As String
Dim aColours As Variant

Const TeamColours As String = "$TEAM-1:50|$TEAM-2:4|$TEAM-3:33|$TEAM-4:6|$TEAM-5:22|$TEAM-6:45|$Misc Events:35" '<- Adjust team names and colour values here

Set rData = Columns("A").Find(What:="Team Name", LookAt:=xlWhole, SearchDirection:=xlPrevious, MatchCase:=False).Offset(1)
Set rData = rData.Resize(Cells.SpecialCells(xlCellTypeLastCell).Row - rData.Row + 1, 9)
Set Changed = Intersect(Target, rData)
If Not Changed Is Nothing Then
Application.EnableEvents = False
On Error GoTo AEET
lc = Cells(3, Columns.Count).End(xlToLeft).Column
Set rTracker = Range("B4").Resize(Columns("A").Find(What:="Report Period", LookIn:=xlValues, LookAt:=xlWhole, SearchDirection:=xlPrevious, MatchCase:=False).Row - 4, lc - 1)
Set rAnchorDate = rTracker.Cells(0, 1)
AnchorDate = rAnchorDate.Value
AnchorCol = rAnchorDate.Column
aColours = Split(TeamColours, "|")
With rTracker
.ClearContents
.Interior.ColorIndex = xlNone
.HorizontalAlignment = xlGeneral
End With
For Each rw In rData.Rows
TeamName = rw.Cells(1).Value
If Len(TeamName) > 0 Then
Set cellTeam = Range("A4:A10").Find(What:=TeamName, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not cellTeam Is Nothing Then
rwTeam = cellTeam.Row

NumDays = rw.Cells(9).Value - rw.Cells(6).Value + 1
oSet = rw.Cells(6).Value - AnchorDate
StartDateCol = AnchorCol + oSet
With Cells(rwTeam, StartDateCol).Resize(, NumDays)
.Cells(1).Value = rw.Cells(2).Value
.HorizontalAlignment = xlCenterAcrossSelection
If InStr(1, TeamColours, "$" & TeamName & ":", vbTextCompare) > 0 Then
TeamClr = Split(Mid(TeamColours, InStr(1, TeamColours, "$" & TeamName & ":", vbTextCompare) + Len(TeamName) + 2), "|")(0)
.Interior.ColorIndex = TeamClr
End If
End With
End If
End If
Next rw
End If
AEET:
Application.EnableEvents = True

--------------------------------------



TABLE 2:


1Report PeriodSep-19
22019-2020SunMonTueWedThuFriSatSunMonTueWedThuFriSatSun
31-Sep-192-Sep-193-Sep-194-Sep-195-Sep-196-Sep-197-Sep-198-Sep-199-Sep-1910-Sep-1911-Sep-1912-Sep-1913-Sep-1914-Sep-1915-Sep-19
4NAME A
5
6
7
8
9
10
11NAME B
12
13
14
15
16
17
18NAME C
19
20
21
22
23
24
25NAME D
26
27
28
29
30

<tbody>
[TH="align: left"][/TH]
[TH="align: left"]A[/TH]
[TH="align: left"]B[/TH]
[TH="align: left"]C[/TH]
[TH="align: left"]D[/TH]
[TH="align: left"]E[/TH]
[TH="align: left"]F[/TH]
[TH="align: left"]G[/TH]
[TH="align: left"]H[/TH]
[TH="align: left"]I[/TH]
[TH="align: left"]J[/TH]
[TH="align: left"]K[/TH]
[TH="align: left"]L[/TH]
[TH="align: left"]M[/TH]
[TH="align: left"]N[/TH]
[TH="align: left"]O[/TH]
[TH="align: left"]P[/TH]

[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]

[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]

[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]
[TD="bgcolor: #000000"][/TD]

</tbody>
SUMMARY SHEET

TABLE 1 shows one of seven duplicate tabs which shows each coach's team schedule. Each tab also has the VBA code included above. My goal is to have the tab name and calendar portion of each coach's tab populate on one summary sheet as in TABLE 2. NAME A is merged from A4:A9, NAME B A11:A16, NAME C A18:A23, etc. I hope this clears thing up a bit.
 
Upvote 0
Sorry, I'm afraid I still don't "get it" so am unable to advise further.
 
Upvote 0

Forum statistics

Threads
1,224,745
Messages
6,180,700
Members
452,994
Latest member
Janick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top