Forum Discussion
Excel userforms
- Dec 30, 2020
I don't see an attachment in your reply.
See the attached workbook. The userform is displayed modeless, and it gets its data from and stores them on the Data sheet.
Thank you very much
I saw that when you renamed the caption of that button that begins the whole chain when first you called it "show..." and then "close...", in the code you called it 'Button 1.' How can I find out the name oof the button so I can program exactly which button I want?
Right-click the button. You'll see its name in the Name box on the left hand side of the formula bar.
- Shaya5Jan 07, 2021Copper Contributor
- Shaya5Jan 07, 2021Copper Contributor
Amazing! thank you so much
- HansVogelaarJan 07, 2021MVP
That is because a rectangle is not a button, and because its actual name is probably Rounded Rectangle 1. You'll have to use
Sheet1.Shapes("Rounded Rectangle 1").TextFrame.Characters.Text = "Show UserForm"
and
Sheet1.Shapes("Rounded Rectangle 1").TextFrame.Characters.Text = "Close UserForm"
- Shaya5Jan 07, 2021Copper Contributor
Thank you. I managed to find the name. however, when I substituted the 'button 1' to the name of my new shape 'Rectangle: Rounded Corners 1,' it came up with an error when I tried opening it. would you have any idea why???
Thanx
- HansVogelaarJan 05, 2021MVP
Right-clicking on a shape should work too.
Alternatively, click Find & Select > Selection Pane on the Home tab of the ribbon.
You will see the names of all shapes on the active sheet. You can click on a name to select the shape.
- Shaya5Jan 05, 2021Copper Contributor
i only managed to find the name of the button when it is a command button. but when I make a shape to which I connect the form to, it doesnt let me see its name. do you have any solutions?
Thank you very much
- Shaya5Jan 05, 2021Copper Contributor