Const dbSti = "C:\Users\peter\Desktop\JesperVejby\DataBase" Private Sub OFok_Click() Dim iRow As Long Dim ws As Worksheet 'open database file Workbooks.Open Filename:=dbSti & "\" & "database.xlsm"
If Trim(Me.OFp.Value) = "" Then Me.OFp.SetFocus MsgBox "Vælg en prioritering" Exit Sub End If
Rem vælg fane efter prioritet If Me.OFp.ListIndex = 0 Then Set ws = Worksheets("prio1") Else Set ws = Worksheets("prio2") End If
'find first empty row in database iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
'check for a part number If Trim(Me.OFb.Value) = "" Then Me.OFb.SetFocus MsgBox "Beskriv kort fejlmeldingen" Exit Sub End If
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.