I have a code that will populate a Userform with buttons and caption them based on a list of names in a worksheet:
Excel.PNG
Essentially what I'm trying to make happen is that when this Userform loads, the user can click any of the buttons and it will save the caption of the selected button to a global string variable 'BtnCaption', hide Userform1 and show Userform2. I've tried to look up how to do this but everything I found didn't really make sense or didn't work with what I'm doing.
Here's my code in Userform1 for creating the button if that helps:
![]()
Please Login or Register to view this content.
Bookmarks