Userform that is filled out when it opens

Even

Board Regular
Joined
Jan 1, 2013
Messages
81
Office Version
  1. 365
Platform
  1. Windows
Hi, I have finally managed to create a working userform (after many, many hours) ? However, whenever I open the userform all textboxes are empty. Is it a way for textboxes to be filled out with values from the cells that I will update?
There are approx 30 boxes and most of the times I just need to update a couple of values. And when I let the boxes be empty and click ok, it deletes the values in the cell - which sucks.

So it would very helpful to have it filled out and I can just update the ones that I want.

Thanks,

Even
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You can do what you want by doing a little research into UserForm_Initialize. This will allow you to fill the text boxes every time you open the userform.
 
Upvote 0
Try something like this:
Modify as needed
Put this script in your Userform
VBA Code:
Private Sub UserForm_Initialize()
'Modified  6/5/2021  11:09:25 AM  EDT
TextBox1.Value = Sheets("Alpha").Range("A1").Value
TextBox2.Value = Sheets("Bravo").Range("G1").Value
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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