VBA form data to specific cells

MNFPGE

New Member
Joined
Mar 5, 2018
Messages
13
Hi, I'm new to forms and a beginner on VBA, so struggling with a VBA to make a user form fill in specific cells in a sheet. I have created the form and now I want to get the data from the fields into the cells on the worksheet and if the cells in the worksheet have data in them for this to be shown in the form fields. I have set up a button in the worksheet to show the userform and I want a button on the userform to save the workbook once the fields have been filled in. Not all the fields will have data in them. I also want a button to close the form once the user has finished. Below shows the location I want the data to end up(Column C) and the names of the fields(Column B) in the form. I haven't really got any VBA so far that is worth posting as I'm lost to start with!:eek:


Cell Formulas
RangeFormula
B83Rail Wall 1
B84Rail Wall 2
B85Rail Wall 3
B86Left Wall 1
B87Left Wall 2
B88Left Wall 3
B89Right Wall 1
B90Right Wall 2
B91Right Wall 3
B92Opp Wall 1
B93Opp Wall 2
B94Opp Wall 3
 
Do you get any errors when you click the SaveWallBraceButton ?
 
Upvote 0

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.
Got it! Code below was what worked. I assume it was closing the form before it was unloading. Thanks so much for your help!
Code:
Private Sub CarWallBraceUserForm()

UserForm3.Show


End Sub
Private Sub CloseFormBtn_Click()
   Dim WS As Worksheet
   Dim Sizes As Long
   Set WS = Worksheets("Questions")
   With WS
      Cells(85, 3).Value = RailPosn1.Value
      Cells(86, 3).Value = RailPosn2.Value
   End With


Unload Me
End Sub
 
Upvote 0
Glad you figured it out & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,999
Members
448,541
Latest member
iparraguirre89

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