Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 24 of 24

Thread: Solved: Hide unhide rows in range

  1. #21
    VBAX Regular
    Joined
    Jul 2010
    Posts
    66
    Location
    can you attach a copy of your workbook? I'm not exactly sure about what you are talking about.

    GComyn

  2. #22
    VBAX Regular
    Joined
    Jul 2010
    Posts
    66
    Location
    I'm not sure what you are talking about.... could you attach a copy of your workbook so we can take a look at it?

    GComyn

  3. #23
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    Hi gcomyn. Sorry for delay. I figured it out. What I had done was put a list in the cell that we would key the name. The list had the names of all the employees. But if I just deleted the name I guess "isempty" did not recognize it was truly empty. So I modified the code so that if target.value = "Hide Row" then run the hide row line. It works perfect now. Thank you so much for you help on this.

  4. #24
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    Hi there. This code you all helped me on is great and again I can't thank you enough. I need a minor edit though. If the cell above has a name in it can I get help with the line to goto the else statement? I want the user to have the cell below the name they just keyed available but can hide the cell 2 cells below. My thoughts were....

    if (target.value -2) <> "" then

    but I can't get it to work.

    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo ERROR
    If (Target.Column = 1) Then

    If Target.Row + 2 < Range("a326").Row Then
    If (Target.Value) = "" Then

    Call MacroUprotectAll
    Rows((Target.Row) & ":" & (Target.Row + 1)).EntireRow.Hidden = True

    Else
    Call MacroUprotectAll

    Rows((Target.Row + 2) & ":" & (Target.Row + 3)).EntireRow.Hidden = False

    End If
    End If
    End If

    Target.Select

    Call ProtectAll

    ERROR:
    End Sub[/vba]

Posting Permissions

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