show or hide textboxes on worksheet.

Leeinsa

Board Regular
Joined
Jul 24, 2009
Messages
96
Can anyone explain what I'm doing wrong here.

I have a questionaire that i need to send to users and have them answer. The first sheet asks them to select a number from a drop down list. Then they click next. When this is done, I need to move them to the next worksheet in the workbook and make the specified number of textboxes visible on it. (all textboxes start with the visible attribute set to false). The code i currently have for when the user clicks next button is shown below. But I get the "Object doesn't support this property or methos" error.

Any help much appreciated.
Lee.

Sub Move_To_Q2()

Dim x As Integer, i As Integer
Dim namestring As Variant

x = Worksheets("Output").Range("B2").Value

For i = 1 To x

If x >= 1 Then
Worksheets("Step 2").TextBox1.Visible = True
Worksheets("Step 2").TextBox31.Visible = True
Else
Worksheets("Step 2").TextBox1.Visible = False
Worksheets("Step 2").TextBox31.Visible = False
End If

End Sub
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,216,759
Messages
6,132,558
Members
449,735
Latest member
Gary_M

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top