Edit from selected list box

newtoVBA2018

New Member
Joined
Dec 14, 2018
Messages
1
Hi All,

very new to VB. I want to be able to edit data from list box. I can get the data to transfer the list box into the text boxes. I then want to be able to edit the text box and move it back into excel. I have stumbling through the below code, but it does not seem to do anything. Any help would be appreciated.


Private Sub Edit_Data_Click()

Dim erowa As Integer, x As Integer, Sheets1 As Worksheet

Set ws = Sheets("Data")

erowa = Application.WorksheetFunction.CountA(ws.Range("A:A"))


For x = 2 To erowa

If ws.Cells(x, "A").Value = Me.TextBox24.Text Then

ws.Cells(x, "B").Value = Me.TextBox2.Text
ws.Cells(x, "C").Value = Me.TextBox3.Text
ws.Cells(x, "D").Value = Me.TextBox4.Text
ws.Cells(x, "E").Value = Me.TextBox5.Text
End If
Next
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I see nothing in this script referring to Listbox

I see Textbox values being entered into sheet cells

Are you saying Listbox when you should say Textbox?
 
Upvote 0
And you said:
I then want to be able to edit the text box and move it back into excel

Back into excel.

It's always been in Excel


Are you saying you want to enter data into row(1) from a list of values in a Listbox?


 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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