Dear All,
I've tried to make 2 userforms for a succession plan office project.
Userform1 (Data Entry)
1st part of the form extracts data from the "master database" sheet.
2nd part of the form is used to enter data into the "succession database" sheet.
This userform works perfect.
Userform2 (Data Edit)
This form is used to first extract and show the data entered into the "succession databse" sheet. The information is shown in textboxes and I expect the changes made to those boxes will overwrite the existing initially entered information in the "succession databse". But that's not happening
Since this is office work, i'm being able to share limited information only. The codes for my USERFORM2 (one used to edit) is given below
'to extract information from succession database
Private Sub ListBox1_Click()
txt17.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 1, False)
txt38.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 2, False)
txt18.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 3, False)
txt19.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 4, False)
txt20.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 5, False)
txt21.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 6, False)
txt22.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 7, False)
txt23.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 13, False)
txt24.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 14, False)
txt25.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 15, False)
txt26.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 16, False)
txt27.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 17, False)
txt28.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 18, False)
txt29.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 8, False)
txt30.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 9, False)
txt31.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 10, False)
txt32.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 11, False)
txt33.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 12, False)
txt34.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 20, False)
txt35.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 21, False)
txt36.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 22, False)
txt37.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 23, False)
End Sub
'to edit/overwrite information
Private Sub CommandButton1_Click()
Range("A1").Select
With ActiveCell.Offset(ListBox1.ListIndex, 0)
.Offset(RowCount, 0).Value = Me.txt17.Value
.Offset(RowCount, 1).Value = Me.txt38.Value
.Offset(RowCount, 2).Value = Me.txt18.Value
.Offset(RowCount, 3).Value = Me.txt19.Value
.Offset(RowCount, 4).Value = Me.txt20.Value
.Offset(RowCount, 5).Value = Me.txt21.Value
.Offset(RowCount, 6).Value = Me.txt22.Value
.Offset(RowCount, 12).Value = Me.txt23.Value
.Offset(RowCount, 13).Value = Me.txt24.Value
.Offset(RowCount, 14).Value = Me.txt25.Value
.Offset(RowCount, 15).Value = Me.txt26.Value
.Offset(RowCount, 16).Value = Me.txt27.Value
.Offset(RowCount, 17).Value = Me.txt28.Value
.Offset(RowCount, 7).Value = Me.txt29.Value
.Offset(RowCount, 8).Value = Me.txt30.Value
.Offset(RowCount, 9).Value = Me.txt31.Value
.Offset(RowCount, 10).Value = Me.txt32.Value
.Offset(RowCount, 11).Value = Me.txt33.Value
.Offset(RowCount, 19).Value = Me.txt34.Value
.Offset(RowCount, 20).Value = Me.txt35.Value
.Offset(RowCount, 21).Value = Me.txt36.Value
End With
Unload Me
End Sub
PLEASE HELP ME!
I've tried to make 2 userforms for a succession plan office project.
Userform1 (Data Entry)
1st part of the form extracts data from the "master database" sheet.
2nd part of the form is used to enter data into the "succession database" sheet.
This userform works perfect.
Userform2 (Data Edit)
This form is used to first extract and show the data entered into the "succession databse" sheet. The information is shown in textboxes and I expect the changes made to those boxes will overwrite the existing initially entered information in the "succession databse". But that's not happening
Since this is office work, i'm being able to share limited information only. The codes for my USERFORM2 (one used to edit) is given below
'to extract information from succession database
Private Sub ListBox1_Click()
txt17.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 1, False)
txt38.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 2, False)
txt18.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 3, False)
txt19.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 4, False)
txt20.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 5, False)
txt21.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 6, False)
txt22.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 7, False)
txt23.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 13, False)
txt24.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 14, False)
txt25.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 15, False)
txt26.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 16, False)
txt27.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 17, False)
txt28.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 18, False)
txt29.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 8, False)
txt30.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 9, False)
txt31.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 10, False)
txt32.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 11, False)
txt33.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 12, False)
txt34.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 20, False)
txt35.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 21, False)
txt36.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 22, False)
txt37.Value = Application.VLookup(Me.ListBox1, Sheets("Succession Database").Range("A:w"), 23, False)
End Sub
'to edit/overwrite information
Private Sub CommandButton1_Click()
Range("A1").Select
With ActiveCell.Offset(ListBox1.ListIndex, 0)
.Offset(RowCount, 0).Value = Me.txt17.Value
.Offset(RowCount, 1).Value = Me.txt38.Value
.Offset(RowCount, 2).Value = Me.txt18.Value
.Offset(RowCount, 3).Value = Me.txt19.Value
.Offset(RowCount, 4).Value = Me.txt20.Value
.Offset(RowCount, 5).Value = Me.txt21.Value
.Offset(RowCount, 6).Value = Me.txt22.Value
.Offset(RowCount, 12).Value = Me.txt23.Value
.Offset(RowCount, 13).Value = Me.txt24.Value
.Offset(RowCount, 14).Value = Me.txt25.Value
.Offset(RowCount, 15).Value = Me.txt26.Value
.Offset(RowCount, 16).Value = Me.txt27.Value
.Offset(RowCount, 17).Value = Me.txt28.Value
.Offset(RowCount, 7).Value = Me.txt29.Value
.Offset(RowCount, 8).Value = Me.txt30.Value
.Offset(RowCount, 9).Value = Me.txt31.Value
.Offset(RowCount, 10).Value = Me.txt32.Value
.Offset(RowCount, 11).Value = Me.txt33.Value
.Offset(RowCount, 19).Value = Me.txt34.Value
.Offset(RowCount, 20).Value = Me.txt35.Value
.Offset(RowCount, 21).Value = Me.txt36.Value
End With
Unload Me
End Sub
PLEASE HELP ME!