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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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