View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

This is on a userform?

I put a combobox and a textbox on a userform. I used this code:

Option Explicit
Private Sub ComboBox1_Change()
Me.TextBox1.Value = Worksheets("sheet1").Range("a1").Text
End Sub

Private Sub UserForm_Initialize()
Dim iCtr As Long
For iCtr = 1 To 10
Me.ComboBox1.AddItem "asdf" & iCtr
Next iCtr
End Sub

====
You may also want to consider using a label--instead of a textbox.


cincode5 wrote:

Hello,

I would like to use a VBA Text Box to display different sets of messages
that can be invoked from various other VBA sub routines. For example, if
someone uses a Pull Down menu to select a User ID, I would llike to use the
Pull Down's Sub Routine to assign a message using Text_Box.Text =
Range("???##").Text.

I don't know if this is the best way to change the contents of a Text Box,
but if someone out there more familiar with VBA can help me to understand the
correct procedure for accomplishing this, I would be greatful for the insight.

--
Regards...


--

Dave Peterson