UserForm TextBox to Specific Cell

Rana Gray

Board Regular
Joined
Jan 26, 2023
Messages
53
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hey everyone,

I know there are a million threads on this topic and I have tried everything and I keep getting a runtime 9 error and I can't figure out what I am doing wrong.

My userform has 4 txt boxes and I want to be able to save the values so I created a sheet [Sheet25] "UserForm" to store the data - here is the code I have:

1679686760388.png


Please help
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I found a work around!

For anyone else having the same issue though:

VBA Code:
Private Sub CommandButton1_Click()
Sheet25.Range("D5").Value = TextBox1.Value
Sheet25.Range("D6").Value = TextBox2.Value
Sheet25.Range("D8").Value = TextBox3.Value
Sheet25.Range("D9").Value = TextBox4.Value
    Unload Me
End Sub
 
Last edited by a moderator:
Upvote 0
Solution

Forum statistics

Threads
1,215,368
Messages
6,124,520
Members
449,169
Latest member
mm424

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