View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default TextBox Event Error

You have not fully referenced the textbox, but I think you are also trying
to create a reference to a textbox as well?

Assuming this is a UserForm control

Private Sub TextBox1_Change()
Dim i As Integer
i = 1
MsgBox Me.Controls("TextBox" & i).Value
End Sub

--

Regards,
Nigel




"Stephen Newman" wrote in message
...
Could somebody explain why this throws an error please?

Private Sub TextBox1_Change()
i = 1
MsgBox TextBox & i & .Value
End Sub

I get this error at .Value:

Compile error:
Invalid or unqualified reference.

If posible, could the correct syntax for writing this be provided?