+ Reply to Thread
Results 1 to 2 of 2

Extreme newb, easy question: Simple button/scrollbar coding

  1. #1
    Registered User
    Join Date
    07-31-2006
    Posts
    1

    Extreme newb, easy question: Simple button/scrollbar coding

    I need to know how to take values from a cell in the worksheet and link them to a scrollbar/spinbar, etc. But I get an error 424 every time I try to use the buttons/bars. It's a class assignment, which is why I seem so clueless: they threw me in to the fire with no knowledge of VB!

    Here's the code

    Private Sub btnReset_Click()
    scrUnitsSold.Value = 25000
    spnPrice.Value = 3000
    spnMaterialCost.Value = 200
    spnMfgCost.Value = 300
    Range("A1").Select
    End Sub



    Private Sub strUnitsSold_Change()
    Range("Units_Sold").Value = scrUnitsSold.Value
    End Sub
    I just have two objects so far: a reset button and a scrollbar. The scrollbar simply links to a cell named "Units_Sold." The reset button sets the other buttons to a default value, and selects A1.

    But I keep getting Run-time error 424. HELP PLEASE!

  2. #2
    NickHK
    Guest

    Re: Extreme newb, easy question: Simple button/scrollbar coding

    Check your typing: Is it "strUnitsSold" or "scrUnitsSold" ?

    Private Sub strUnitsSold_Change()
    Range("Units_Sold").Value = scrUnitsSold.Value
    End Sub

    NickHK

    "BlackSeaBandit"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > I need to know how to take values from a cell in the worksheet and link
    > them to a scrollbar/spinbar, etc. But I get an error 424 every time I
    > try to use the buttons/bars. It's a class assignment, which is why I
    > seem so clueless: they threw me in to the fire with no knowledge of VB!
    >
    >
    > Here's the code
    >
    > > Private Sub btnReset_Click()
    > > scrUnitsSold.Value = 25000
    > > spnPrice.Value = 3000
    > > spnMaterialCost.Value = 200
    > > spnMfgCost.Value = 300
    > > Range("A1").Select
    > > End Sub
    > >
    > >
    > >
    > > Private Sub strUnitsSold_Change()
    > > Range("Units_Sold").Value = scrUnitsSold.Value
    > > End Sub
    > >

    >
    > I just have two objects so far: a reset button and a scrollbar. The
    > scrollbar simply links to a cell named "Units_Sold." The reset button
    > sets the other buttons to a default value, and selects A1.
    >
    > But I keep getting Run-time error 424. HELP PLEASE!
    >
    >
    > --
    > BlackSeaBandit
    > ------------------------------------------------------------------------
    > BlackSeaBandit's Profile:

    http://www.excelforum.com/member.php...o&userid=36965
    > View this thread: http://www.excelforum.com/showthread...hreadid=566876
    >




+ 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