Make userform to input data the spreadsheet follow condition

Hero123

New Member
Joined
Sep 25, 2017
Messages
6
Hello everyone
I want to make the userform in vba
1. Information on spreadsheet
Model Name Value
EDM1 WIRE1 .......
EDM2 WIRE2 ........
2. I want to make new userform when i input value of model and name on the userform then that valude will be input to Value colume of spreadsheet.
Please help me this situation.
Thank you for reading.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
We always need exact details.

Are you saying you have Models in Column "A" of your sheet and Names in column "B"
And when you want Value put in column "C"

I would suggest having two Listbox's on the userform and we load all the Models into listbox1 and the Names into listbox2.

Then have a Textbox where you enter the value.

And a command button to click which runs the script

Select the name in listbox1 and the model in listbox2 then click a button and the value in the textbox will be entered into column "C" adjacent to the Model and Name.

If this sounds like something you want give me the name of the sheet the name of the two listboxs and the name of textbox and command button.

We can then write a script for you.

If this is not what you want explain more in detail.
 
Upvote 0
I am sorry i did not describe full details
properly like you said
I want to make userform with 3 text box : model ,name ,value and 1 button .
I select value model and name text box , input data for value textbox then click the button
data of value textbox will be entered into column "C" adjacent to the Model and Name which value of its are fixed
Please help me .thanks
zPtYgNC.jpg
[/IMG]
 
Upvote 0
Your image does not show this:
Your quote:
I want to make userform with 3 text box

I see two comboboxes and one textbox and one command button.

Do you not agree these are Comboboxes and one textbox

And I asked for the names of all these:

Is this "ComboBox1" and "ComboBox2" and "TextBox1"
 
Upvote 0
Assuming you have a:
ComboBox1 and a
ComboBox2 and a
TextBox1 and a Command Button1


This script will load all the values in Column "A" into ComboBox1 and
Load all the values in Column "B" into Combobox2

Then when you select a value in Combobox1 and ComboBox2 and run the script in CommandButton1

The value in TextBox1 will be entered in column "C"

Code:
Private Sub CommandButton2_Click()
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Dim i As Long
    For i = 1 To Lastrow
        If Cells(i, 1).Value = ComboBox1.Text And Cells(i, 2).Value = ComboBox2.Text Then Cells(i, 3).Value = TextBox1.Value
    Next
End Sub
Private Sub UserForm_Initialize()
ComboBox1.List = Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row).Value
ComboBox2.List = Range("B2:B" & Cells(Rows.Count, "B").End(xlUp).Row).Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

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