Excel VBA Address Book Example

Kadr Leyn
1 min readAug 27, 2018

--

Address Book Userform

With this userform ;
- Data can be added
- Data can be deleted
- Data can be edited
- Data can be searched on the sheet
- Listbox can be filled and emptied with button.
- Listbox can be scrolled with the spin button.

Id numbers are generated automatically when new record is added to the worksheet and when record is removed.
Userform’s Listbox Contains 12 Column.Maximum 10 columns can be added to the listbox with ListBox1.AddItem Method. To solve this problem, we have filled the listbox an array.

Do
m = m + 1
ReDim Preserve myarr(1 To 12, 1 To m)
For j = 1 To 12
myarr(j, m) = .Cells(k.Row, j + 1).Value
Next j
Set k = .Range(“B2:B” & Cells(Rows.Count, “B”).End(xlUp).Row).FindNext(k)
Loop While Not k Is Nothing And k.Address <> adrs
ListBox1.Column = myarr
……

Also we added a new macro to avoid duplicate data entry in Column B (names in this column).

Sample file and details at : Excel advanced address book

--

--

Kadr Leyn

A crazy man who likes net,pc,programming,music,nature