ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using User forms to enter data into lists (https://www.excelbanter.com/excel-programming/297318-using-user-forms-enter-data-into-lists.html)

Saar Ben-Attar

Using User forms to enter data into lists
 
I built a financial model in Excel, which uses several product inputs and
then calculates various profit scenarios.
I now wish to make it easier for users to use the model by:
(i) Building lists for product data to be stored (in the background)
(ii) Adding user forms, so that users do not manipulate lists directly.

I am familiar with lists, and know of the Data-Form command, which generates
a plain form. However, I need to generate a customised form, with the
company logo and some data validation.

I managed to design the front-end of the form, by dragging controls into the
worksheet area, but am unsure as to how to link the form to the list (i.e.:
when the user enters data into the form, the list is updated).

Can anyone help?




Harald Staff

Using User forms to enter data into lists
 
Hi

My advice is to not link the controls with the cells, but rather make your
code validate and if OK then write to the cells. See if this get you
started:

Private Sub CommandButton1_Click()
Dim R As Long
'VALIDATION HERE, THEN
'R = Row to write to, after last entry:
R = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(R, 1).Value = TextBox1.Text
Cells(R, 2).Value = TextBox2.Text
Cells(R, 3).Value = ComboBox1.Text
' and do on,
' then empty the controls
' or unload the form
End Sub

HTH. best wishes Harald

"Saar Ben-Attar" skrev i melding
...
I built a financial model in Excel, which uses several product inputs and
then calculates various profit scenarios.
I now wish to make it easier for users to use the model by:
(i) Building lists for product data to be stored (in the background)
(ii) Adding user forms, so that users do not manipulate lists directly.

I am familiar with lists, and know of the Data-Form command, which

generates
a plain form. However, I need to generate a customised form, with the
company logo and some data validation.

I managed to design the front-end of the form, by dragging controls into

the
worksheet area, but am unsure as to how to link the form to the list

(i.e.:
when the user enters data into the form, the list is updated).

Can anyone help?







All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com