Log in

View Full Version : Copy the value of a textbox from UserForm2 to another textbox of UserForm1



BonoGiox
01-11-2017, 05:15 PM
Hi everybody,
i'm sorry but i didnt find the correct solution in other threads...:banghead::banghead::banghead:
i have a macro on ppt with 2 userform ( 1 & 2 ). In userform1 i have a textbox in which i put a number and then i click on a button and it starts duplicating some slides i chose. After this, it changes userform. I want that on a textbox on userform2 appears the number i put on the textbox on userform1. i tried with "Me" istruction and many other but nothing... ( i read other threads but it didnt solve my problem :(:(

thanks again:yes

John Wilson
01-13-2017, 11:22 AM
When you say "After this, it changes userform" does form 1 unload and form 2 load?

If so you can use the QueryClose event of form 1 to load the value into a Public variable and the Activate event of form 2 to load the value in the variable. There are many other scenarios e.g. using the change event of the first textbox to set the variable.