A source for learning how to use User Forms?

matonanjin

New Member
Joined
Jul 29, 2018
Messages
11
I have such a broad scope question I thought it might just be best to spend some time learning VBA User forms.

The question is this. When I design and then Userform.show I of course use the userform initialize to have the user put all the stuff in the text boxes and choose from the comboxes and then stuff that into the different sheet cells.

But then how do I use the userform to grab stuff from sheet cells and then have the user modify it and put back into the sheet? I can't use the initialize event again. I don't think I can.

I can't even come up with some code to post here to have you guys rip on me. If you can just point me in a couple directions to study I reasoned might be best staring point.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Very small tidbit... UserForm.TextBox1 = Workbooks("Workbook_Name.xlsx").Worksheets("Sheet1").Range("A1") and vice versa.
 
Upvote 0
You can do a Google search for Excel VBA User Form and get a lot of useful results.
 
Upvote 0
Is this what you mean?
Code:
Private Sub CommandButton1_Click()
    Me.TextBox1 = Sheets("Sheet1").Range("A1").Value
End Sub
While the UserForm is open, change the text in the TextBox and run this
Code:
Private Sub CommandButton2_Click()
    Sheets("Sheet1").Range("D5").Value = Me.TextBox1
End Sub
 
Upvote 0
Yes, but you should qualify the Workbook that the sheet is in.
VBA Code:
Workbooks("Workbook_Name.xlsx").Sheets("Sheet1").Range("D5")
 
Upvote 0
No sorry needed because you are right.
I have the bad habit thinking that the OP's should do that but that is of course not so.
Thanks for that Skybot.
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,069
Members
449,092
Latest member
ipruravindra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top