A problem in VB

  • Thread starter Thread starter JF
  • Start date Start date
J

JF

im just wondering if anyone can figure out the code to
the following problem ( this is driving me spare): im
using office xp, i want a check box that when checked
will allow you to click a seperate button and it will
then speak the text content of a cell, but when unchecked
if you click the button it wont speak the text.

i know it soundsw long and complex but any help will be
apriciated, thanks.

JF
 
In the Check Box:

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
CommandButton1.Enabled = True
Else
CommandButton1.Enabled = False
End If
End Sub

In the Button:

Private Sub CommandButton1_Click()
MsgBox Cells(1, 1).Value
End Sub

Cells(1, 1).Value points to cell "A1".
(2, 1) would point to "A2".
(1, 2) would point to "B1" and so forth...

Be sure to have the button saved witht the "Enabled"
property set to "False".

- Pikus
 
Back
Top