+ Reply to Thread
Results 1 to 3 of 3

Count number of textboxes

  1. #1
    april27
    Guest

    Count number of textboxes

    hi. anyone knows how to count the number of textboxes in a user field. i want
    to create an array in which i insert the values from the textboxes. since the
    number of textboxes is variable i want the length of the array to be
    varaiable. therefore it would be great if you could count the number of
    textboxes and then set the length of the equal to that. PLease help neede!!

  2. #2
    Ardus Petus
    Guest

    Re: Count number of textboxes

    Public Function countTextboxes(oUF As UserForm) As Long
    Dim iCtrl As Long
    For iCtrl = 0 To oUF.Controls.Count - 1
    If TypeName(oUF.Controls(iCtrl)) = "TextBox" Then
    countTextboxes = countTextboxes + 1
    End If
    Next iCtrl
    End Function

    That might be sufficient for Dimming your array, not to populate it.

    HTH
    --
    AP

    "april27" <april27@discussions.microsoft.com> a écrit dans le message de
    news: 480B1A56-10F9-4400-A67A-90C73BACFAA2@microsoft.com...
    > hi. anyone knows how to count the number of textboxes in a user field. i
    > want
    > to create an array in which i insert the values from the textboxes. since
    > the
    > number of textboxes is variable i want the length of the array to be
    > varaiable. therefore it would be great if you could count the number of
    > textboxes and then set the length of the equal to that. PLease help
    > neede!!




  3. #3
    Bob Phillips
    Guest

    Re: Count number of textboxes

    I repeat, show the code!

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "april27" <april27@discussions.microsoft.com> wrote in message
    news:480B1A56-10F9-4400-A67A-90C73BACFAA2@microsoft.com...
    > hi. anyone knows how to count the number of textboxes in a user field. i

    want
    > to create an array in which i insert the values from the textboxes. since

    the
    > number of textboxes is variable i want the length of the array to be
    > varaiable. therefore it would be great if you could count the number of
    > textboxes and then set the length of the equal to that. PLease help

    neede!!



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1