View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
furbiuzzu furbiuzzu is offline
external usenet poster
 
Posts: 57
Default Message box [how it works??]

i've inserted a toggle button in my excel sheet (sheet "ratings").
i want, by clickin' on it, a message box to appear.
the text of this message box is allocated on a cell of a different
sheet (named: labels) of the same excel file.

if i put these lines on togglebutton code:

Private Sub ToggleButton1_Click()
text = Range("labels!A980").Value
MsgBox (text)
End Sub

it doesn't work!

if i write a macro named 'totali'
and associate it to toggle button code it works. why??

here's the effective code that works :

Sub totali()
Dim testo As String
text = Range("labels!A980").Value
MsgBox (text)
End Sub

Private Sub ToggleButton1_Click()
Application.Run "My.T.y.M.xls!totali"
End Sub

thanks !