Consulting

Results 1 to 3 of 3

Thread: Forward thinking obstacle

  1. #1
    VBAX Newbie
    Joined
    Jan 2008
    Posts
    5
    Location

    Forward thinking obstacle

    I want to create a sheet that will act as a counter for different items and display it visually with a bar. I would also like to be able to add and remove items with control boxes etc. With Andy Pope's help I can create a visual counter that adjusts size to whatever I put in "e11"

    The problem i forsee is that I set the variable range size (display bar) to the value of "e11". If I use control boxes etc. to add more items with a different counter value below ("e12") how do I get a new display bar since I won't be able to set the variable without editing the code?

  2. #2
    VBAX Newbie
    Joined
    Jan 2008
    Posts
    5
    Location
    Sorry, this might help....it is what i have now

    Sub untilevent()

    Dim untilevent As Long
    Dim rngData As Range
    Dim maxBarView As Long
    maxBarView = 45
    untilevent = Range("E11").Value

    Set rngData = Range("I10").Resize(1, untilevent + maxBarView)
    rngData.Select
    Selection.Interior.ColorIndex = xlNone

    Set rngData = Range("I10").Resize(1, untilevent)
    rngData.Select
    With Selection.Interior
    .ColorIndex = 44
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    End With

    End Sub

  3. #3
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    If you are displaying a bar why not use a chart?

    Or maybe you need to explain in more detail the effect your are trying to achieve.
    Cheers
    Andy

Posting Permissions

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