Saving Data From User Form To Excel Worksheet


I am new to this VBA business and I have created a user form using VBA in excel to capture data from users. Now i need to save the data from the text boxes and combo boxes I created to be stored in particular cells on particular worksheets. How can i do this?


Free Excel Help Forum

- Ask any question about Excel and have it answered in no time.

Similar Excel Tutorials

Close Excel Workbook using VBA Macros
How to close an Excel workbook using VBA and macros, including how to save the file before you close it or discard ...
Use a Form to Enter Data into a Table in Excel
You can enter data into a table in Excel using a form; here I'll show you how to do that. This is a great feature ...
Input Form to Get Data and Store it in Another Tab in Excel
How to make a user input form in Excel and have the data stored on another worksheet at the click of a button. This ...
Prevent a User from Changing Any Data in Excel
I'll show you how to lock a spreadsheet so that nothing can be changed in it. This is a great feature to use when ...

Helpful Excel Macros

Print Selected Worksheets in Excel
- This free excel macro will print all selected worksheets in Excel. If there are no other worksheets selected the active
Disables the "Save As" Feature in Excel
- This macro will disable the Save As feature in excel. This means that a user will not be able to resave the workbook un
Excel Macro to Save a Specific Worksheet as a New File
- This Excel Macro allows you to save a specific worksheet within the Excel Workbook to its own new file. You will be a
Save the Current Worksheet as a New Excel Workbook File
- This Excel Macro will save the currently visible/active worksheet (the one that you see when you run the macro) to a
Print Preview Display for Specific Worksheets in Excel
- This free Excel macro allows you to display the print preview mode or window in Excel for a specified Excel worksheet.

Similar Topics

I have a user form with various text boxes, option buttons, tick boxes and combo boxes.

The form is to be used to raise and update various jobs/faults.

I wish to have one of the tick boxes as an option to close the job down. Can anyone help me with the code that will lock out the form for editing when it is clicked.

Also I dont know where to start with code that will grey out certain areas of the form once a certain value is selected from a combo box.


I am attempting to create a user form. :o :o
I have created 8 option boxes on my user form.
I have a combobox created on my user form.
Can I add code the when I select option1, it would give me the data from my "Sheet1('sheet1's name is RB) Column C" into my combo box.
Then if I select option2 Sheet2('Sheet2's name is WR) Column C would enter into the combobox.
I have code written that once I choose the item in the combo box, it then places the info into the active cell.

I already thought about making a master list with all the data from all the sheets, but I really would rather them be separate.

Thank you,

I need to create a Form that will enter data into a worksheet. The Workbook has a worksheet for every month. The form would need a way to select a worksheet. The user would then select a day of the month from another list box and this would let the form know which row to add the data to. There would be several text boxes that the user would enter data into and those text boxes would be directed at specfic columns. Any help would be greatly appreciated.


Hi all! I am new to this so forgive the ignorance.

I've been playing with forms and I know that excel creates a user form from any row of data. it also retrieve the data using the find next command button on the form.

I've been reading some of the post to see if I can figure out how to do that on my form and quite frankly I get a little lost. So here is my post.

I created a user form with many fields in it. The form will be used at different times to insert different data. So I wanted to have the users of the form be able to retrieve the data at a later time so they could complete the form and then re-save it.

Since I don't know how to do that I don't really know what it is called. If you could direct me to some examples I would appreciate it much.

I have a user form which has text boxes and a combo box on it. I want to recall whatever text (text boxes) and value from a list (combo box) the user selected the last time the macro was run. My idea is to store that information in a cell on a hidden worksheet called "programing". My guess there is probibly a better way to do this with code. Is there??

I have a form with multiple combo boxes relating to basic customer information from a table. What I want on this form are multiple combo boxes that allow the user to set the criteria they are looking for and hit a commband button that will run that filtered data and open another form.
I have gotten this to work with just one combo box, but it does not recognize the other criteria.

Here is the vba I am using from the ******* command button:

Private Sub Command5_Click()
DoCmd.OpenForm "ALLCUSTOMERSFORM", , , "[BROKER] = """ & Me![Combo1].Column(0) & """"
DoCmd.OpenForm "ALLCUSTOMERSFORM", , , "[ZONE] = """ & Me![Combo2].Column(0) & """"

End Sub

What it is currently doing is just opening the All Customers Form based on the last combo box selected (ie, only from that zone).
In the end, I'll have many combo boxes, so I need something that will work.

Any suggestions are appreciated!

I have a user form which contains a frame. Within this frame tehre are a number of text boxes where the user is asked to enter numerical information.

I would like to create a data validation so that when the user clicks teh done button on the user form, the procedure is halted and a message prompted if one of the text boxes is left blank.

How can i code this?

I have a user form which includes some text boxes (txtRUL.text for example) where I want to enter a number as a percentage. I divide the number entered by 100 to avoid Excel automatically multiplying by 100 and the result is displayed in the user form as the correct percentage.

Private Sub txtRUL_AfterUpdate()
txtRUL.Value = Format(txtRUL.Value / 100, "0.0%")

(I'm sorry I cant figure out how to format this code as code in this post)

This works well, trouble is when I save and it writes the results to the worksheet, the numbers in the user form revert back to plain unformatted non percentage numbers (ie 5% goes to 0.05)

Any ideas?

I have a excel spreadsheet which contains multiple userforms, This is hosted on my companies "Intranet" and as such when opened by the user it opens within Internet explorer.

Currently we are still using Microsoft office 2003 within the workplace.

The problem is that the company are (finally) upgrading from IE6 to IE8 and as a result of this the combo boxes which are a major component of my user form have stopped working.

When opening the workbook using IE6 then it opens within the browser and works without any problems (Or rather only very minor issues which the end user can resolve) and the combo boxes within the user-forms actually work correctly as drop-down boxes (They are populated by referencing a named range on a hidden sheet within the workbook)

However if a user who has got IE8 installed tries to use the form then the combo-boxes do not populate.

Does anybody have any ideas as to how I can solve this issue as unfortunately our company IT section do not care as: Quote:

We didn't design the form therefore its not our problem if it breaks

Any help would be appreciated. If required I can send the workbook but would rather not post it therefore will email to people if required.

Hey all,

I have a form (based on a query) that displays a variety of data in text boxes. I have the form properties set to allow edits, but I am not able to change data/numbers in the text boxes. The text boxes are not locked either.

The uses parameter values passed from another form to filter the data.

What seems weird is that when I open the exact same database in Access 2007 it allows me to edit the form data like I wish, but when I open it in Access 2003 it does not seem to work properly.

I need to have the ability for it to work in 2003 and 2007 as users of my database use both versions of Access.

Thank you for the help!


I wish to create a User Form that will show the values of some cells when a row is selected and allow one of the cell's values to change.

For instance, I select the entire row 5. Then I call up the user form. I want the value of the cells in columns A and B to appear in the form. I want to be able to change the value of B5, either by subtracting or adding.

It seems that the only way to have the values of Columns A and B show in the user form is in text boxes, though I do not want either to be editable. I want to have two other separate text boxes for either adding or subtracting the value of B5. Upon clicking an Enter button, the value of B5 changes and the user form should close.

I realize there are a lot of questions here. The book I am using to learn VBA--"Excel Programming"--doesn't answer them. I am using Excel 2003.



I am trying to get a text box on a VBA user form in Excel to automatically calculate based on the inputs of 2 other text boxes on the same user form.

For example, let's call Text Box1 "Price" and Text Box2 "AmountPaid". I want Text Box3 (AmountOwing) to calculate the difference between the amounts manually typed in these 2 text boxes by the user and automatically populate Text Box3 with the result.

Any suggestions on the best way to do this? Does anyone have a good example I can replicate or feel like coming up with some code?

Much appreciated!

I'm trying to put together a simple user form using a text box to capture some numbers and save to the spreadsheet as a number not text. I've got everything working but no matter what I try it saves as test.

Here is the code I'm using to save the data to the spreadsheet.

'Find the next row
nextrow = Worksheets("Invoice amt").Cells(Rows.Count, 1).End(xlUp).Row + 1
'Wrtie the values from this form to that row
With Worksheets("Invoice amt")
.Cells(nextrow, 1).Value = Me.tbSchB_No
.Cells(nextrow, 2).Value = Me.tbDom_Forn
.Cells(nextrow, 3).Value = Me.tbNo_Pcs
.Cells(nextrow, 4).Value = Me.tbDol_AMT
.Cells(nextrow, 5).Value = Me.tbWeight_lb
.Cells(nextrow, 6).Value = Me.tbNet_Wt

End With

Unload Me

I have created a User Form with about 60 Text Boxes. The text boxes are all linked to Control Source cells in a sheet of my workbook. Changing the number in the text box changes the number in the control source cell and vice versa. Some of the text boxes take inputs from the user. Other text boxes display calculated results in the User Form. I don't like the format of the numbers in the text boxes for which the displayed results are calculated. In some cases, way too many significant digits are displayed (e.g., 0.0099999999 instead of 0.0100 or 600.6784536 instead of 600.68 or 0.0000003614564 instead of 3.61E-07). When the text box is NOT linked to a control source cell, I can format the number by code suce as TextBox1 = Format(Expression, "0.00E+00"). But when the text box is linked to the control source cell, it ignores the format code. How can I specify the number format of a text box that is likned to a control source cell? Thanks.

I have two worksheets in one workbook... The worksheet 'data' contains some data that I need to copy and paste into certain cells in another worksheet called 'form'. for each row of data I need a new worksheet created from the 'form' worksheet.

Basically for each row of data in my 'data' worksheet (321 rows) I need a new worksheet created from my template worksheet 'form'. the data that I need copied from the 'data' worksheet is in cols B-G, and I need this data pasted into the 'Form' worksheet into cells B4 - G4.
The names of the new worksheets created doesnt matter, i suppose they just have to be unique.

Also I would like to fill in the date field which is located in column J in my 'data' worksheet and have this pasted into H8 in my 'form' worksheets.

Also, the rows of data will change daily, it will not always be 321 rows.

I'm fairly new to VB... So any help would be GREATLY appreciated!

btw, I am using office 2k3 on Windows 7.

I tried using this code to create the new worksheets, it worked but, it only creates 254 new worksheets then errors out. Option Explicit

Sub Copy_Sheets()

Dim i As Integer
Dim wks As Worksheet

Set wks = Sheets("data")

For i = 1 to 360
Sheets("form").Copy After:=Sheets(2)
ActiveSheet.Name = wks.Cells(i, 2)
ActiveSheet.Cells(1, 2)=wks.Cells(i, 2)

End Sub Thanks!!


I have a user form with combo boxes and text boxes, Depending on the values chosen I want to call some other values from a worksheet and fill a row in an array for manipulation and then outputting to a worksheet.

For example:
The user selects Apple from the first combo box User types 50 in the first text box The user selects Banana from the second combo box The user types 30 in the second combo box code checks the named range for Apple first row of array is filled with the values next to the word apple. The values are divided by 100(a constant) and then multiplied by 50(the user variable) code checks the named range for Banana second row of the array is filled with the values next to the word Banana. The values are divided by 100(a constant) and then multiplied by 30(the second user variable) The values in the 'columns' are added and put in to a worksheet.
I uploaded some sample data

Hey guys,

I have been developing an order form for my department to provide to a client and have run into an issue. The form has simple categories with form control combo boxes that output a value to a linked cell. i then use the =INDEX formula for an adjacent cell to display the price for the correlating value so that it "looks" like they are selecting a product and the price is displayed. all good and well.

The problem is my boss wants me to now set a precedent for the drop down boxes. The user first selects the carrier which will determine which selections are available in the drop down boxes.

I am beginning to think that this cannot be done with form control drop downs. I really dont want to get into VB code because i simply dont know it.

Is there some kind of work around for this?

Thank you!

Good morning

I would appreciate some help with the following:

I've got a Userform that a user uses for auditing purposes.

The user would like to enter a negative value in some text boxes, but the moment one type a "-" in the text box, a "0" appears.

I believe I will have to change formatting or something but is not sure of the code?

Otherwise I can use combo boxes which will enable the user to select a negative value, but it will be quite a job to change the 37 text boxes to combo boxes and I assume there must be an easier way ...


Hello All,

I'm new to VBA so bare with me. I am trying to setup a userform that will allow the user to enter data and search my "Data" sheet and output the resulting rows into the "Results" sheet. The user form will have a combination of check boxes and txt boxes with one search button at the bottom. I want it to be able to search each criteria and narrow down the results if found, if nothing is entered in the box I just want it to skip over it and move on to the next search field.

What is the best way to approach this, there are so many different ways I've seen people do it. Will the .find command work for that many criteria? Will a VB loop work better?

I have already created the user form UserData. I have also added a Search button on the "Results" sheet to start the macro. I want the first 4 check boxes to correspond to column D starting at row 12. I need the check boxes, if checked to search for a string with the same label beside it.

If somone can just help me out getting started, I know i can fill in the rest. I just don't know how to setup a multi search criteria and filter the results and output them to another sheet.



I have a userform that pops up upon opening a file. The user form has
5 text boxes names Zero, Two, Four, Seven and Nine. I would like each of these text boxes to automatically populate with the values last used. The values last used are stored in Worksheet "Index Settings" in Cells "C3:C7". Any help on the coding for this would be much appreciated.

Okay so I assume that an If statement would be the best for what i need but if you have another type of code that will be fine.

Situation: I have a work sheet that as of right now i have a User form that opens when the worksheet is opened. The user form you place data in is copied to its respective cells when closed then my clients can request material and save the form and email it to my supervisor for processing. The thing is when my supervisor opens the form i dont want that user form to pop up since the clients already entered the data. He isnt exactly computer savy so i feel it will be a nusiance for him to have to cancel the user form every time. So can anyone help with a code that will basically say when i open this sheet display user form "HeaderInfo" If cell A5 is blank, and if the cell contains data do not display the user form.

Thank you in advance!

Hi all,

I am trying to find a Cell reference (a row number will do) from a named range in a worksheet by selecting an entry from a Combo Box.

I should point out that I am using a Combo Box from the Visual Basic Toolbox, in a User Form, not in a Worksheet, in Excel 2003.

I need to generate the Cell reference / row number as the form needs to allow the user to edit the value of that cell (in the Combo Box) when it has been selected and save it.

I.e. select "Production Resources" from the list in the Combo Box, (from the Range listed in the Row Source) and change the value in the Combo Box field to "Production Operations" and click a Command Button to save the new Combo Box value into the Cell reference of the old value.

At the moment I a have a Text box and two Command Buttons to move up and down the list, but this takes some time when there are over eighty items in the list.

This question is in a similar vein to others on the board but they don't quite give me the answer I'm looking for.

I am happy to post the existing code that I am using, but there is a fair bit of it.

Any help on this will be greatly appreciated.


I have designed a form with 26 textboxes. Each is name in the form of
txtName, txtAmount and so forth.

I would like to lock these boxes with a few lines of code without having
to put a line in for each box. Maybe something in the order of

For each TextBox in Worksheet
.locked = true.

but I haven't been able to figure out how to do it. I found a 'For
Each' example in Help but it appears not to apply to text boxes.

I know I can do it with individual lines for each box but had much
rather use a looping method. Then, if I added some more text boxes I
wouldn't have to put additional lines in the code to lock each box.

Can anyone suggest a way to do this?

Thank you very much.

Hello Everyone.

I have created a data entry user form in Excel as a front end, and I want the userform data to be stored in the Microsoft access database at the backend

is it possible that the userform excel can be on a shared mode, and if I save on a local server path, and at a single time 4 or 5 persons can save a new data on the userform....

Will these 4 or 5 new data will reach a database and create new rows.... or will it be overridden on the same row for 5 times..

I am very much confused on this...

Thanks in advance , if somebody can help me really....

Hey all,

I have posted this problem on VBA Express also, If you would like to see the history of my post and the replies here is the link...

I am trying to populate a ComboBox on a user form with a list that is on a different sheet in the same workbook. This list will be popluated by code that I have already written and that part works great, but I am new to UserForms and do not know how to populate the ComboBox with the values in the list. I have had several suggestions from all the wonderful Vbaxers but to no avail, I am still having problems. I have posted a sample of the workbook on VBA Express and would do the same here but for some reason it says "You may not post attachments". If you want to see the sample workbook I have it attached on VBA Express. There are actually two different things I am trying to accomplish.

1. I want either a list box or combo box that will get its contents from a range that is located on another sheet in the same workbook. This list is a single column but will change in length fairly regularly through code I have already written in another module which is working perfectly. I was trying to set the RowSource property but I cannot get it to work and take into account when the list changes. I figured it may be better to reference it with a named range but I do not know how to pass the named range to the list box or combo box. What this list box/combo box will do is search for a match on the sheet that calls the user form then move to that cell.

2. On the same user form there will be 3 - 4 text boxes which will pass new data into the cells once the "Enter" button is pushed. I know how to pull up a blank userform and pass the entrys in the userform to cells but what I would like is once the list box/combo box moves to the cell it searched for I would like the text boxes on the user form to populate with any values that are currently in those cells (if any) or blank if no values exist which can then be overwritten with new values to be passed to the cells. Any suggestions?