+ Reply to Thread
Results 1 to 3 of 3

hide/unhide rows depending on the top input value

  1. #1
    TiDz
    Guest

    hide/unhide rows depending on the top input value

    Hi
    I need help to edit macro below that specific range of rows could
    hiding/unhiding depending on the top input value.
    In this instance the results are changing dynamically when the input values
    are changed:

    "Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngIn As Range
    Dim rngOut As Range
    Dim iMax As Long


    Set rngIn = Me.Range("A1:C1")
    Set rngOut = Me.Range("A3:A40")

    iMax = Application.Max(rngIn)

    If Not Intersect(rngIn, Target) Is Nothing Then
    On Error GoTo XIT
    Application.EnableEvents = False
    Range(rngOut, rngOut.End(xlDown)).ClearContents
    Set rngOut = rngOut.Resize(iMax + 1)
    rngOut(1) = 0
    rngOut.DataSeries Rowcol:=xlColumns, Type:=xlLinear, _
    Step:=1, Trend:=False
    End If

    XIT:
    Application.EnableEvents = True

    End Sub"

    Thanx in advance!

  2. #2
    Bob Phillips
    Guest

    Re: hide/unhide rows depending on the top input value

    Which rows get hidden? You can toggle like so

    Rows("12:20").Hidden = Not Rows("12:20").Hidden

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "TiDz" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > I need help to edit macro below that specific range of rows could
    > hiding/unhiding depending on the top input value.
    > In this instance the results are changing dynamically when the input

    values
    > are changed:
    >
    > "Private Sub Worksheet_Change(ByVal Target As Range)
    > Dim rngIn As Range
    > Dim rngOut As Range
    > Dim iMax As Long
    >
    >
    > Set rngIn = Me.Range("A1:C1")
    > Set rngOut = Me.Range("A3:A40")
    >
    > iMax = Application.Max(rngIn)
    >
    > If Not Intersect(rngIn, Target) Is Nothing Then
    > On Error GoTo XIT
    > Application.EnableEvents = False
    > Range(rngOut, rngOut.End(xlDown)).ClearContents
    > Set rngOut = rngOut.Resize(iMax + 1)
    > rngOut(1) = 0
    > rngOut.DataSeries Rowcol:=xlColumns, Type:=xlLinear, _
    > Step:=1, Trend:=False
    > End If
    >
    > XIT:
    > Application.EnableEvents = True
    >
    > End Sub"
    >
    > Thanx in advance!




  3. #3
    TiDz
    Guest

    Re: hide/unhide rows depending on the top input value

    Hi Bob
    Actually I need that depanding on the top value (from 1 to 40) in the
    specific range stay on adequate quantity of the 40 rows in the specific range
    in the sheet.


    "Bob Phillips" rašė:

    > Which rows get hidden? You can toggle like so
    >
    > Rows("12:20").Hidden = Not Rows("12:20").Hidden
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "TiDz" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi
    > > I need help to edit macro below that specific range of rows could
    > > hiding/unhiding depending on the top input value.
    > > In this instance the results are changing dynamically when the input

    > values
    > > are changed:
    > >
    > > "Private Sub Worksheet_Change(ByVal Target As Range)
    > > Dim rngIn As Range
    > > Dim rngOut As Range
    > > Dim iMax As Long
    > >
    > >
    > > Set rngIn = Me.Range("A1:C1")
    > > Set rngOut = Me.Range("A3:A40")
    > >
    > > iMax = Application.Max(rngIn)
    > >
    > > If Not Intersect(rngIn, Target) Is Nothing Then
    > > On Error GoTo XIT
    > > Application.EnableEvents = False
    > > Range(rngOut, rngOut.End(xlDown)).ClearContents
    > > Set rngOut = rngOut.Resize(iMax + 1)
    > > rngOut(1) = 0
    > > rngOut.DataSeries Rowcol:=xlColumns, Type:=xlLinear, _
    > > Step:=1, Trend:=False
    > > End If
    > >
    > > XIT:
    > > Application.EnableEvents = True
    > >
    > > End Sub"
    > >
    > > Thanx in advance!

    >
    >
    >


+ 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