for loop

  toga 17:21 29 Mar 2010

Hello, I am using a form in excell 97 and I am trying to use a for loop (via a user form) to loop through a number of text boxes; altering the value of each text box.

Private Sub Command1_Click()
for i = 1 to 3
me.textbox(i).value = i
End Sub

The textboxes are named txtbox1, txtbox2 and txtbox3. I was trying to use i to alter the name. I get a message stating that an object is not declared.

I have also looked to see if I could set the index property to 1, 2 and 3 respectively but can't find where to do this.

Can anyone help?

Many thanks

  bremner 19:48 29 Mar 2010

This is much more than an "Absolute Beginners" type question.

If you don't get a response after a period you may be better closing this thread and re-posting in the Helproom.

  ronalddonald 12:17 02 Apr 2010

give it about a week then post this same question on the Helproom.

  Chris the Ancient 11:28 03 Apr 2010

This question does also appear in the Helproom.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Samsung Galaxy S9 review

Wacom Cintiq Pro 24 and 32 review – hands-on

When is the next Apple event?

Les meilleures séries Amazon Prime Video (2018)