Excel VBA - Create Controls Dynamically in a UserForm at Runtime|Adding Multiple TextBoxes Fastly

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ต.ค. 2024

ความคิดเห็น • 36

  • @claudineyribeiro518
    @claudineyribeiro518 10 หลายเดือนก่อน +1

    Nice code. I am from Brazil and I am a developer in VBA and started sharing my tutos on my channel Programando em Excel para todos

  • @mtotowamungu8259
    @mtotowamungu8259 2 ปีที่แล้ว

    I don't know for what you need this, very nice I think how you have built the video and that you provide the code.
    Thumbs up and subscription.
    Thank you very much, I am very curious about your ideas.

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  2 ปีที่แล้ว +1

      This is a part of the project. Dynamic objects are very effective in programming.

  • @danp6101
    @danp6101 ปีที่แล้ว +2

    How can you add textboxes ,lables or buttons dynamically and be able to use the click_Event or MouseOver_Event or any event
    with each textbox, lable or button separately

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  ปีที่แล้ว

      This is a broad topic. I have written about this to several of our valued subscribers, sir

    • @danp6101
      @danp6101 ปีที่แล้ว

      @@TheWorldOfAlgorithms
      Can you supply me any information you may have written and where.
      Thanks

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  ปีที่แล้ว

      @@danp6101 It's a pity that I only share the information here (when I have time). Sir, what topic do you need support for ?

    • @danp6101
      @danp6101 ปีที่แล้ว

      @@TheWorldOfAlgorithms
      On the UserForm_Initialize event
      i know how to add button, labels, textboxes etc... but i would like to know how can i make the mousemove_event work or any other event work with the buttons, labels or textboxes that are added dynamically with the UserForm_Initialize event.
      or lets say i have a button on the form
      and when i click on it. it adds 20 labels now when i mouse over the labels i want to trigger the mousemove_event.
      i hope you understand what i mean.

  • @MohAboAbdo
    @MohAboAbdo 2 ปีที่แล้ว

    Thank you so much

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  2 ปีที่แล้ว +1

      Thank you very much for watching the channel regularly

  • @hanzo-e9p
    @hanzo-e9p 2 ปีที่แล้ว

    thank you so much
    how you are able to assign the name of the text box by using this "t_name = "Btn" & (btn_cnt + 1)"? is it by default or this is a user-defined variable?

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  2 ปีที่แล้ว

      Thank you very much for your support. Share the video so that more people are aware of such videos.
      t_name ➡UDV (User-Defined Variable)
      btn_cnt ➡ UDV (User-Defined Variable)
      Dynamic objects are a very interesting topic. Also this topic is important for programming. If there is more demand, I can make a long and detailed video about it

    • @hanzo-e9p
      @hanzo-e9p 2 ปีที่แล้ว

      @@TheWorldOfAlgorithms yes, please make a detailed video, can you also show how to add an event for each added control?

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  2 ปีที่แล้ว

      Dynamic objects are for solving problems like this

  • @parvezkhot8392
    @parvezkhot8392 ปีที่แล้ว

    How to use Change Event and Exit Event in these TextBox

  • @BHARAT279
    @BHARAT279 10 หลายเดือนก่อน +1

    Sir how to add more name in serail in single text box example
    1 fhfhhj
    2 dhFbg
    3 fbdnfj
    4 rhfhfj
    5 fhdbg
    Kaise kare pls bataye

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  10 หลายเดือนก่อน +1

      Hi Sir!
      Do you have a question about this video or are you interested in how to do it ? I think this simple macro can be useful for you:
      TextBox1.MultiLine = True
      If TextBox1.Text = Empty Then
      TextBox1.Text = YOUR_TEXT
      Else:
      TextBox1.Text = TextBox1.Text & vbNewLine & YOUR_TEXT
      End If

    • @BHARAT279
      @BHARAT279 10 หลายเดือนก่อน

      Problem solved

    • @BHARAT279
      @BHARAT279 10 หลายเดือนก่อน

      @@TheWorldOfAlgorithms new problem is how to print preview user form

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  10 หลายเดือนก่อน +1

      Have you used the code I wrote ? I think this was a very simple code and could solve your problem

    • @BHARAT279
      @BHARAT279 10 หลายเดือนก่อน

      @@TheWorldOfAlgorithms code is what or where I found this

  • @rafaelvasquezfurlan
    @rafaelvasquezfurlan ปีที่แล้ว

    Thank you so much! Do you know if is possible to save the userfo.rm after the changes that you did? For example: if you include 3 textbox and close the userform. Than he next time that you open, show the userform with the 3 textbox that you add at last time

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  ปีที่แล้ว

      Sir, of course it is possible. It would be appropriate to create a database for this

    • @rafaelvasquezfurlan
      @rafaelvasquezfurlan ปีที่แล้ว

      @@TheWorldOfAlgorithms could you do an example? I will appreciate that! Thank you so much!

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  ปีที่แล้ว

      @@rafaelvasquezfurlan Of course. I will provide a small example of this for you personally. The main thing is that the process is completely clear to you. Based on this, you can apply any different algorithm in your project. My only request to you is to share the video as much as possible so that people who want to learn VBA are aware of this channel. Good luck!

    • @TheWorldOfAlgorithms
      @TheWorldOfAlgorithms  ปีที่แล้ว +1

      And that's it! I made a video according to your request. th-cam.com/video/jRgMZCKX3js/w-d-xo.html

    • @rafaelvasquezfurlan
      @rafaelvasquezfurlan ปีที่แล้ว

      @@TheWorldOfAlgorithms thank you so much! Could we talk by email?

  • @byteseq
    @byteseq 6 หลายเดือนก่อน

    1. Terrible Indentation
    2. As Byte is inefficient
    3. Variable names like i, j, k, nn are not a good practice anymore
    4. Showing people how to dynamically add controls is uselesss when you do not show them how to interact with then and catch events.