Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bill Howell   on Nov 01 In MS Office Category.

  
Question Answered By: Vidhya Iyer   on Nov 01

Array is not a legal name for a variable, I've used "Items". Also, you
don't need Me (it's implied because the code  is inside the user form's
module).

You need the Controls collection, which can be indexed by control name:

Items(X) = Controls("TextBox" & X)

Lastly, Excel starts numbering text  boxes and other controls from 1, not
from zero, so there won't be a TextBox0 unless you specifically call one
that.

Or you can use X as a simple subscript into the collection. In this case,
the subscripts do start at zero.

Items(X) = Controls(X)

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on calculating 'names' of text boxes in a form Or get search suggestion and latest updates.


Tagged: