Retrieve TextBox value on CommandButton_Click()

Solved
P4pacCino Posted messages 3 Status Member -  
f894009 Posted messages 17417 Registration date   Status Member Last intervention   -
Hello everyone,

I am in my second year of a BTS SIO with a programming option and I have a software automation project (BENCHMARK).

Here is my request:
I have several TextBoxes, exactly 8 on the same UserForm, and I would like to be able to enter my values and retrieve them when I click on the "Launch" button (which will run the macro)

Do you have any ideas?
Attached is a screenshot of my UserForm (see UserForm1.png)



Thank you in advance.

1 answer

  1. f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717
     
    Hello,

    ex:

    Private Sub Cmd_Lancement_Click() a = TextBox1 b = TextBox2 c = TextBox3 'and so on End Sub
    0
    1. P4pacCino Posted messages 3 Status Member
       
      Hello f894009 and thank you for your feedback

      Could you tell me a little more:
      For example: "Number of cameras": If I type 1, 2 or 3... and hit "launch test" will it retrieve the entered value, with the code you sent me?

      I remind you that the goal is to run a macro with arguments given by the user (UserForm)
      0
    2. P4pacCino Posted messages 3 Status Member
       
      I think I understand the principle of assigning a letter to Txt_Box, but I'm not sure about your answer.
      0
      1. f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717 > P4pacCino Posted messages 3 Status Member
         
        Re,

        the code I presented is a principle, you need to use the names of your textboxes for the transfer into your variables that will be used in your code (run a macro with arguments given by the user (UserForm)).
        0