> ...but the line Me.Controls.Text1.Visible gives me an error.
You use the Controls collection when you want to refer to a control by its
name. E.g.,
Me.Controls("TextBox1").Visible = False
If you are referring directly to the control, omit the Controls reference:
Me.TextBox1.Visible = False
--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
"Charlie" <(E-Mail Removed)> wrote in message
news:74A9CFC8-54C2-4F52-A217-(E-Mail Removed)...
>I couldn't get that to work: I said combobox, but meant textbox, earlier,
>so
> let me start over:
>
> I have ComboBox1 & TextBox1. A change is made to ComboBox1, which affects
> TextBox1. If TextBox1 is blank (no string), then I need the property
> .visible of TextBox1 to be set to False. I think this all happens here?
>
> Private Sub ComboBox1_Change()
> Worksheets("sheet1").Range("C16") = Me.ComboBox1.Value
> TextBox1 = Worksheets("Sheet1").Range("B23").Value
> If TextBox1.Value = "" Then
> Me.Controls.TextBox1.Visible = False
> Else
> Me.Controls.Text1.Visible = True
> End If
> End Sub
>
> ...but the line Me.Controls.Text1.Visible gives me an error.
> It must be close to being right...
>