View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] alexdetrano@gmail.com is offline
external usenet poster
 
Posts: 12
Default Executing Macro Help

yes, that is correct. I have the combo box always present, so that
even if I change tabs, I have the option of choosing a scenario.
Currently, when I pick a scenario, the macro is executed on the
current worksheet. This is no good, as it overwrites things that are
there. So I need the macro to change only the cells in the rev
worksheet. I'm thinking I need to change the lines inside the macro
to have the rev title in front of the cell, but I'm not sure how to do
this. Here's my code for the rev page

Private Sub ComboBox1_Change()
Select Case Me.ComboBox1.Value
Case "basic": Call base
Case "increased": Call Increased
Case "decreased": Call Reduced
Case "superior": Call Superior
Case "inferior": Call Inferior
End Select
End Sub

Private Sub Worksheet_Activate()
cboScenario.Show vbModeless
End Sub


-----------------

here is my code for the macro called basic (which is an option in the
combo box)

Sub base()
'
' base Macro
' Macro recorded 4/16/2007 by User
'

'
Range("B83").Select
ActiveCell.FormulaR1C1 = "415"
Range("B84").Select
ActiveCell.FormulaR1C1 = "235"
Range("B85").Select
ActiveCell.FormulaR1C1 = "50"
Range("B86").Select
ActiveCell.FormulaR1C1 = "25"
Range("B87").Select
ActiveCell.FormulaR1C1 = "75"
Range("B88").Select
ActiveCell.FormulaR1C1 = "70"
Range("B89").Select
ActiveCell.FormulaR1C1 = "98"
Range("B90").Select
ActiveCell.FormulaR1C1 = "126"
Range("A90").Select
ActiveCell.FormulaR1C1 = "Occupancy-90% -3RD "
Range("A89").Select
ActiveCell.FormulaR1C1 = "Occupancy-70% -2ND"
Range("A88").Select
ActiveCell.FormulaR1C1 = "Occupancy-50% -1ST 4 MO."

End Sub