+ Reply to Thread
Results 1 to 22 of 22

hiding unhiding rows macro hierarchy

Hybrid View

dgibney hiding unhiding rows macro... 09-29-2014, 06:35 PM
natefarm Re: hiding unhiding rows... 09-30-2014, 05:56 PM
dgibney Re: hiding unhiding rows... 09-30-2014, 06:14 PM
natefarm Re: hiding unhiding rows... 10-03-2014, 05:29 PM
dgibney Re: hiding unhiding rows... 10-03-2014, 06:53 PM
natefarm Re: hiding unhiding rows... 10-06-2014, 09:33 AM
dgibney Re: hiding unhiding rows... 10-06-2014, 10:25 AM
natefarm Re: hiding unhiding rows... 10-06-2014, 03:57 PM
dgibney Re: hiding unhiding rows... 11-07-2014, 05:31 PM
dgibney Re: hiding unhiding rows... 11-07-2014, 05:33 PM
natefarm Re: hiding unhiding rows... 10-06-2014, 11:26 AM
dgibney Re: hiding unhiding rows... 10-07-2014, 05:37 PM
natefarm Re: hiding unhiding rows... 11-07-2014, 06:23 PM
dgibney Re: hiding unhiding rows... 11-07-2014, 06:30 PM
natefarm Re: hiding unhiding rows... 11-07-2014, 06:34 PM
natefarm Re: hiding unhiding rows... 11-10-2014, 11:22 AM
dgibney Re: hiding unhiding rows... 11-17-2014, 07:19 PM
natefarm Re: hiding unhiding rows... 11-18-2014, 12:19 PM
dgibney Re: hiding unhiding rows... 11-18-2014, 02:36 PM
natefarm Re: hiding unhiding rows... 11-18-2014, 03:10 PM
dgibney Re: hiding unhiding rows... 11-18-2014, 07:03 PM
natefarm Re: hiding unhiding rows... 11-19-2014, 01:44 PM
  1. #1
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: hiding unhiding rows macro hierarchy

    I think you've got it, but let me elaborate, just to be sure... (And I apologize it's so confusing.)

    First, individual team members will not select which goals they want to pursue, the team will select them collectively. So, all team members will pursue only the pool of tasks that are not hidden in the "Tasks" sheet.

    Second, For each row usually only one team members will be assigning hours, but not all. What's important is for the rows of tasks that are supposed to be revealed are always revealed except when a team member is filtering the list to only see those (revealed)tasks for which they have hours assigned in their column.
    Third, when they've done this and want to un-filter the rows (by clicking the black "Show All Team Tasks" button) only those tasks that should be revealed are revealed. I've had problems with the Worksheet change macro not re-directing the hiding or unhiding or rows correctly when clicking this black button.

    Another way to look at it is a matter of hierarchy. After any filtering/unfiltering there should be a routine to verify that only the correct rows are revealed per what was selected in the "Goals" sheet.

    Thanks again Nate! David

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: hiding unhiding rows macro hierarchy

    I didn't need to insert a column B, since it was already blank. See if this will be a good start for you.

    Instead of buttons on each column, I added a combo box (cboEmpList) to select the employee you want. It is populated from a list on a new Employees sheet, which you will need to maintain to match the names in TASKS row 1.

    Select the desired tasks on the GOALS sheet, then switch to TASKS and pick the desired employee. The showing/hiding of rows and columns is triggered by the TASKS WorksheetActivate event, as well as by the cboEmpList_Change event. The code should work automatically as is when you add new goals/tasks in GOALS columns B:J, and as you add/change/delete employees on TASKS and Employees. However, if you add or change goals/tasks, then switch to the TASKS sheet, it may display error messages trying to find them (until you get them added there also).

    Have fun.

    Dwarfs.xlsm
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: hiding unhiding rows macro hierarchy

    Hi Nate, I apologize for being absent for a month. I had a heavy task placed on me and couldn't spend time on this. I have a few questions for you. The tool that I'm building has enough goals that in the preferred format they are arranged in two "columns" to fit an 8.5 X 11 cleanly. Please take a look at the "Dwarf Scorecard" attachment to get an idea of what the finished product is intended to look like. I need your help figuring out how to allow two "columns" of goals, with tasks. There are also a few features that I did not describe to you, any of which may interfere with your code. (I really like your solution, BTW. Thanks.) Could you please take a look at these below and let me know if you see any issues?

    The first feature is that each goal is assigned credit points in Yes|Maybe|No columns and these points are tallied to provide a final score. There are a maximum number of points possible for each goal and these are listed in columns "I" and "S". Now take a look at the second attachment "Dwarf point control". When the total number of points in any row does not equal the Possible Point value, all three cells (Yes|Maybe|No) are orange. When the point tally does equal the Possible Points these cells are light green. This is the macro I used to achieve this:
    Sub Section1Code(Target)
    Dim a As Double
    a = Application.WorksheetFunction.Sum(Range("B7:D7"))
    If a < Range("I7") Then
        Range("B7:D7").Interior.Color = RGB(255, 165, 0)
        Else
    If a = Range("I7") Then
        Range("B7:D7").Interior.Color = RGB(216, 228, 188)
            End If
        End If
    End Sub
    If the total points exceed the value an error message pops up. This is via Data Validation.

    Finally, to limit the scorecard to just show the goals and credit point distribution I've inserted a button to open or close columns "J" and "T". The code for that is straightforward:
    Private Sub CheckBox1_Click()
    If Sheets("SCORECARD").CheckBox1.Value = False Then
        Call Hide_JT
        End If
    If Sheets("SCORECARD").CheckBox1.Value = True Then
        Call Unhide_JT
        End If
    End Sub
    Sub Hide_JT()
    ActiveWorkbook.Sheets("SCORECARD").Columns("J").EntireColumn.Hidden = True
    ActiveWorkbook.Sheets("SCORECARD").Columns("T").EntireColumn.Hidden = True
    End Sub
    Sub Unhide_JT()
    ActiveWorkbook.Sheets("SCORECARD").Columns("J").EntireColumn.Hidden = False
    ActiveWorkbook.Sheets("SCORECARD").Columns("T").EntireColumn.Hidden = False
    End Sub
    I also made the pull-downs auto-reveal so clicking on the side button isn't required. Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        Dim ValidationType As Variant
        
        If Target.Cells.Count = 1 Then
            If Not Intersect(Range("J:J,T:T"), Target) Is Nothing Then
                On Error Resume Next
                ValidationType = Target.Validation.Type
                On Error GoTo 0
                If Not IsEmpty(ValidationType) Then
                    Application.SendKeys "%{DOWN}"
                End If
            End If
        End If
                
    End Sub
    Would you mind taking a stab at expanding the original Dwarf document to include two "Columns" and the credit point columns? For it's worth this "Scorecard" will be the final format in terms of total columns and rows. The total number of affiliated Tasks is over six hundred.

    Thanks Nate. I really appreciate any direction you can provide. David

  4. #4
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: hiding unhiding rows macro hierarchy

    Oops, here are the attachments. Sorry.
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hiding/Unhiding rows
    By cool53 in forum Excel General
    Replies: 8
    Last Post: 10-25-2013, 02:31 AM
  2. [SOLVED] Hiding/Unhiding Rows
    By marcheese in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-26-2012, 10:25 AM
  3. Hiding/Unhiding Rows
    By marcheese in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 11:56 PM
  4. Hiding and unhiding rows
    By Ranjani in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2009, 02:37 AM
  5. Hiding/Unhiding rows
    By Arne Hegefors in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2006, 03:25 AM

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