Home > Excel Tutorial > The Address Book Userform (Userform’s Listbox Contains 12 Column)

The Address Book Userform (Userform’s Listbox Contains 12 Column)

A follower of the blog wanted this example.

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.

excel vba listbox more than 10 column

Download Userform Example

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: