excel error

S

Steve

I have been writing an excel/vba application and have run
into problems when making changes.

On start up I present a form to the user to choose how
they would like to input data, according to the choice the
spreadsheet displays cells in a certain way.

Inevitably the requirements have changed so that the input
choices can be made at any time, not only on start up.

Basically the code now fails when I hook it up to on sheet
buttons. Why would this be? Presumably some initialisation
problem that I have overlooked?

Code examples....from the form - these methods fail if I
move them to buttons on the sheet itself.

Private Sub TenInputsOptionButton_Click()
InitialisationModle.alterSheetTenInputs
End Sub

Private Sub ThreeInputOptionButton_Click()
InitialisationModule.alterSheetThreeInputs
End Sub

....and this is the specific code that falls over

'reveals an area of cells that was previously hidden
'the previous font and interior colours are restored
'Rng is an object that specifies the Range of cells that
will be affected
'Default_Value is an integer or double specifies the
default value of the cells
Private Sub Reveal_Cells(Rng As Range, Default_Value As
Variant)
Rng.Interior.ColorIndex = 19
Rng.Font.ColorIndex = 5
Rng.Value = Default_Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top