Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:20:38+00:00 2026-06-11T10:20:38+00:00

I have an excel UserForm that creates textboxes during execution time. code as follows;

  • 0

I have an excel UserForm that creates textboxes during execution time. code as follows;

Dim CompHandler() As New CCompHandler
Dim tb As MSForms.TextBox   
Dim count As Integer
For i in Range(something)
    If i = anotherthing Then
        Set tb = UserForm1.Controls.Add("Forms.TextBox.1", "tb" & count)
        With tb
            .Width = iTbWidth
            .Top = count * distance
            .Left = iTbLeft
            .Height = iTbHeight
            .Value = Cells(row, column)
            ReDim Preserve CompHandler(0 To count)
            Set CompHandler(count).TextBoxGroup = tb
        End With
    count = count + 1
    End If
Next i

I want to write back the changed value to the corresponding cell.
I’m already able to get when the box has changed and the new value with this code on a class called CCompHandler:

Option Explicit

Public WithEvents TextBoxGroup As MSForms.TextBox

Private Sub TextBoxGroup_Change()

    MsgBox TextBoxGroup

End Sub

So.. any ideas on how can I get which textbox has changed?
Or maybe is there a better way of doing that?
Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:20:40+00:00Added an answer on June 11, 2026 at 10:20 am

    The Tag property is typically used for something like this. On creation add something like:

    With tb
      ...
      .Tag = i.Address
    ...
    End With
    

    You can then access the Tag property later, with something like:

    Debug.Print tbWhoseValueHasChanged.Tag
    

    Your code snippet has a lot of undefined/unclear variables, including i. I assumed it was a range variable in the above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wrote a code that can read an excel 2007 file using Microsoft
I have an excel csv with a date/time column and a value associated with
I have a excel file which is as follows . 1 Kr Veerappan 123
I have an Excel spreadsheet that I have exported from some other program. It
I have an excel sheet that has several headers. One of the header is
I wrote the following code under the assumption that Excel will die with Monkey:
I have an excel spreadsheet that has dates in the first column, the rest
In excel vba I have added a commandbutton to userform... like below Set ctrl
I'm new to c#.net I have excel sheet and I want to import into
Currently, I have an Excel spreadsheet with some data and a command button that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.