Type osoba maticniBr As Long ime As String prezime As String datumR As Date adresa As String telefon As Double End Type Function saveBinFile() Dim O As osoba Dim maticni As Long 'vrijednost kucice Dim strSize As Long Open "c:\popis.bin" For Binary Lock Read Write As 1 For f = 1 To 50 Worksheets("list1").Select maticni = Cells(f + 1, 1) O.maticniBr = maticni O.ime = Cells(f + 1, 2) O.prezime = Cells(f + 1, 3) O.datumR = Cells(f + 1, 4) Worksheets("list2").Select O.adresa = Application.WorksheetFunction.VLookup(maticni, Range("A2:e51"), 4, False) O.telefon = Str(Application.WorksheetFunction.VLookup(maticni, Range("A2:e51"), 5, False)) Put 1, , O Next f 'sljedeci red Close 1 'zatvorimo datoteku End Function Function UcitajRed(KojiRed As Integer) Dim RedP As osoba 'red podataka za ososubu Dim t As osoba Dim temp Dim I As Integer Open "c:\popis.bin" For Binary As #1 For I = 1 To KojiRed Get #1, , RedP Next I temp = Trim(RedP.ime) & " " & Trim(RedP.prezime) & vbCr & "Rodjen: " & Trim(RedP.datumR) _ & vbCr & "Adresa:" & Trim(RedP.adresa) _ & vbCr & "Matcini br:" & Trim(RedP.maticniBr) & vbCr & "Tel:" & Trim(RedP.telefon) Close #1 MsgBox temp End Function