How to edit, amend or delete a row's information through list box userform

cnu nagula

Board Regular
Joined
Aug 28, 2008
Messages
83
i need a code to edit, amend or delete a row in a sheet through listbox.
i am having textboxes 9 to 15.
i am using the following code for listbox1 for selecting the name from cell b2


Private Sub UserForm_initialize()
ListBox1.List = Worksheets("Details").Range("b3", Worksheets("Sheet2").Range("b65536").End(xlUp)).Value
End Sub


please help
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
i am using the following code for updating sheet2 rows

Private Sub save_Click()
'next empty cell in column A
Set c = Worksheets("Details").Range("a65536").End(xlUp).Offset(1, 0)
Application.ScreenUpdating = False 'speed up, hide task
'write userform entries to database
c.Value = Me.TextBox1.Value
c.Offset(0, 1).Value = Me.TextBox1.Value
c.Offset(0, 2).Value = Me.TextBox2.Value
c.Offset(0, 3).Value = Me.TextBox3.Value
c.Offset(0, 4).Value = Me.TextBox4.Value
c.Offset(0, 5).Value = Me.TextBox5.Value
c.Offset(0, 6).Value = Me.TextBox6.Value
c.Offset(0, 7).Value = Me.TextBox7.Value
c.Offset(0, 0).Value = Me.TextBox8.Value
'clear the form
With Me
.TextBox1.Value = vbNullString
.TextBox2.Value = vbNullString
.TextBox3.Value = vbNullString
.TextBox4.Value = vbNullString
.TextBox5.Value = vbNullString
.TextBox6.Value = vbNullString
.TextBox7.Value = vbNullString
.TextBox8.Value = vbNullString
End With
Application.ScreenUpdating = True
'ListBox1.Clear 'Gollem
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,944
Latest member
2558216095

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