E
excelent
Hi experts
For som reason i cant save changes i made in a form to sheets "Ark2"
I start showing a list of names/addresses... (Private Sub liste_Click)
Then i pick a name from the list (ListBox1_Click) and then make the changes
Then i click save changes (cmdOk_Click).. but no changes is writed to the
shet !!!
Anybody have a cloue ? help please
Private Sub liste_Click()
'show list of names
ListIndex = 0
rk = Sheets("Ark2").Cells(100, 1).End(xlUp).Row
ListBox1.ColumnCount = 4
ListBox1.RowSource = "Ark2!A1" & rk
Me.ListBox1.Visible = True
End Sub
------------------------------------------
Private Sub ListBox1_Click()
' chose a name in listbox
Dim x As Variant
rk = Sheets("Ark2").Cells(100, 1).End(xlUp).Row
x = Range("Ark2!A1" & rk)
valg = Me.ListBox1.ListIndex + 1
Me.txtNavn = x(valg, 1)
Me.txtAdresse = x(valg, 2)
Me.txtArbnr = x(valg, 3)
Me.txtAfd = x(valg, 4)
Me.ListBox1.Visible = False
ListIndex = 0
End Sub
--------------------------------------------
Private Sub cmdOk_Click()
'Save changes on heet
Worksheets("Ark2").Activate
rk = Cells(100, 1).End(xlUp).Row + 1
If Application.WorksheetFunction.CountIf(Range("C2:C" & rk), CDec(txtArbnr))
End If
Cells(rk, 1) = Me.txtNavn
Cells(rk, 2) = Me.txtAdresse
Cells(rk, 3) = CDec(Me.txtArbnr)
Cells(rk, 4) = Me.txtAfd
Worksheets("Ark2").Range("A2:A" & rk).Name = "Navne"
End Sub
For som reason i cant save changes i made in a form to sheets "Ark2"
I start showing a list of names/addresses... (Private Sub liste_Click)
Then i pick a name from the list (ListBox1_Click) and then make the changes
Then i click save changes (cmdOk_Click).. but no changes is writed to the
shet !!!
Anybody have a cloue ? help please
Private Sub liste_Click()
'show list of names
ListIndex = 0
rk = Sheets("Ark2").Cells(100, 1).End(xlUp).Row
ListBox1.ColumnCount = 4
ListBox1.RowSource = "Ark2!A1" & rk
Me.ListBox1.Visible = True
End Sub
------------------------------------------
Private Sub ListBox1_Click()
' chose a name in listbox
Dim x As Variant
rk = Sheets("Ark2").Cells(100, 1).End(xlUp).Row
x = Range("Ark2!A1" & rk)
valg = Me.ListBox1.ListIndex + 1
Me.txtNavn = x(valg, 1)
Me.txtAdresse = x(valg, 2)
Me.txtArbnr = x(valg, 3)
Me.txtAfd = x(valg, 4)
Me.ListBox1.Visible = False
ListIndex = 0
End Sub
--------------------------------------------
Private Sub cmdOk_Click()
'Save changes on heet
Worksheets("Ark2").Activate
rk = Cells(100, 1).End(xlUp).Row + 1
If Application.WorksheetFunction.CountIf(Range("C2:C" & rk), CDec(txtArbnr))
rk = Range("C2:C" & rk).Find(CDec(txtArbnr), LookIn:=xlValues).Row0 Then
End If
Cells(rk, 1) = Me.txtNavn
Cells(rk, 2) = Me.txtAdresse
Cells(rk, 3) = CDec(Me.txtArbnr)
Cells(rk, 4) = Me.txtAfd
Worksheets("Ark2").Range("A2:A" & rk).Name = "Navne"
End Sub