E
error messageVBAcodeoutsideprocedure
Range("I18").Value = 2000
spnUnitCost = 50000
scrAnnualSalesGrowth = 1500
scrAnnualPriceDecrease = 300
scrMargin = 5000
Range("A22").Select
GuitarsSold = InputBox("Guitars Sold in 2004?", "Enter")
Do While GuitarsSold <= 0
Guitars Sold = InputBox("Guitars Sold in 2004 must be > zero.", "Please
Re-enter")
Loop
Range("I6").Value = GuitarsSold
lblUnitCost = Format$(spnUnitCost.Value / 100, "currency")
Range("I19").Value = spnUnitCost.Value / 100
Range("I20").Value = scrAnnualSalesGrowth.Value / 1000
'Reset Command Button procedure Author: Jeff Quasney
'Date Created: 5/8/2005
'Run from: Financial Statement by clicking button labeled Reset
'Function: This procedure initializes the scroll bars, the spin
' button, cell I6, and then selects cell A22
'
Private Sub btnReset_Click()
Range("I18").Value = 2000
spnUnitCost = 50000
scrAnnualSalesGrowth = 1500
scrAnnualPriceDecrease = 300
scrMargin = 5000
Range("A22").Select
End Sub
'Units Sold in 2004 Command Button procedure Author: Jeff Quasney
'Date Createed: 5/8/2005
'run from: Financial Stastement by clicking the Guitars Sold in 2004 button
'Function: This procedure accepts a value for the Guitars Sold in 2004
' (cell I6) and validates it to ensure that it is greater
' than zero.
'
Private Sub binGuitarsSold_Click()
GuitarsSold = InputBox("Guitars Sold in 2004?", "Enter")
Do While GuitarsSold <= 0
GuitarsSold = InputBox("Guitars Sold in 2004 must be > zero.", "Please
Re-enter")
Loop
Range("I19").Value = GuitarsSold
End Sub
'Unit Cost Spin Button procedure Author: Jeff Quasney
'Date Created: 5/8/2005
'Run from: Financial Statement by using the Unit Cost spin button
'Functiion: this procedure assigns the value of the Unit Cost spin button to
' the Unit Cost Spin Button Label control and to cell I7
'
Private Sub spnUnitCost_Change()
1 b1UnitCost = Format$(spnUnitCost.Value / 100, "currency")
Range("I19").Value = spnUnitCost.Value / 100
End Sub
'Annual Sales Growth Scroll Bar procedure Author: Jeff Quasney
'Date Created: 5/6/2005
'Run from: Financial Statement by using the Annual Sales Growth scroll bar
'Function: this procedure assigns the value of the Annual Sales Growth
scroll bar
' scroll bar to cell I8
'
Private Sub scrAnnualSalesGrowth_Change()
Range("I20").Value = scrAnnualSalesGrowth.Value / 1000
End Sub
'Annual Price Decrease Scroll Bar procedure Author; Jeff Quasney
'Date Created: 5/8/2005
'Run from: Financial Statement by using the Annual Price Decrease scroll bar
'Function: This procedure asigns the value of the Margin Scroll
' bar to cell I10 Private Sub scrMargin_Change()
Range("I22").Value = scrMargin.Value / 1000
End Sub
spnUnitCost = 50000
scrAnnualSalesGrowth = 1500
scrAnnualPriceDecrease = 300
scrMargin = 5000
Range("A22").Select
GuitarsSold = InputBox("Guitars Sold in 2004?", "Enter")
Do While GuitarsSold <= 0
Guitars Sold = InputBox("Guitars Sold in 2004 must be > zero.", "Please
Re-enter")
Loop
Range("I6").Value = GuitarsSold
lblUnitCost = Format$(spnUnitCost.Value / 100, "currency")
Range("I19").Value = spnUnitCost.Value / 100
Range("I20").Value = scrAnnualSalesGrowth.Value / 1000
'Reset Command Button procedure Author: Jeff Quasney
'Date Created: 5/8/2005
'Run from: Financial Statement by clicking button labeled Reset
'Function: This procedure initializes the scroll bars, the spin
' button, cell I6, and then selects cell A22
'
Private Sub btnReset_Click()
Range("I18").Value = 2000
spnUnitCost = 50000
scrAnnualSalesGrowth = 1500
scrAnnualPriceDecrease = 300
scrMargin = 5000
Range("A22").Select
End Sub
'Units Sold in 2004 Command Button procedure Author: Jeff Quasney
'Date Createed: 5/8/2005
'run from: Financial Stastement by clicking the Guitars Sold in 2004 button
'Function: This procedure accepts a value for the Guitars Sold in 2004
' (cell I6) and validates it to ensure that it is greater
' than zero.
'
Private Sub binGuitarsSold_Click()
GuitarsSold = InputBox("Guitars Sold in 2004?", "Enter")
Do While GuitarsSold <= 0
GuitarsSold = InputBox("Guitars Sold in 2004 must be > zero.", "Please
Re-enter")
Loop
Range("I19").Value = GuitarsSold
End Sub
'Unit Cost Spin Button procedure Author: Jeff Quasney
'Date Created: 5/8/2005
'Run from: Financial Statement by using the Unit Cost spin button
'Functiion: this procedure assigns the value of the Unit Cost spin button to
' the Unit Cost Spin Button Label control and to cell I7
'
Private Sub spnUnitCost_Change()
1 b1UnitCost = Format$(spnUnitCost.Value / 100, "currency")
Range("I19").Value = spnUnitCost.Value / 100
End Sub
'Annual Sales Growth Scroll Bar procedure Author: Jeff Quasney
'Date Created: 5/6/2005
'Run from: Financial Statement by using the Annual Sales Growth scroll bar
'Function: this procedure assigns the value of the Annual Sales Growth
scroll bar
' scroll bar to cell I8
'
Private Sub scrAnnualSalesGrowth_Change()
Range("I20").Value = scrAnnualSalesGrowth.Value / 1000
End Sub
'Annual Price Decrease Scroll Bar procedure Author; Jeff Quasney
'Date Created: 5/8/2005
'Run from: Financial Statement by using the Annual Price Decrease scroll bar
'Function: This procedure asigns the value of the Margin Scroll
' bar to cell I10 Private Sub scrMargin_Change()
Range("I22").Value = scrMargin.Value / 1000
End Sub