Help me understand listbox code please.

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Please can you help me understand the code in the supplied screen shot.

I see the code shows x = 3 to last row.
So the values are from row 3 then down the page, I get that.

The blue arrow -1, please advise.

The green arrow is where the values will be placed in the listbox, columns start at 0, I get that.

The red arrow is where the value that will populate listbox are to be taken from, so x is row 3 then the numbers are each column on worksheet, I get that.
 

Attachments

  • 75428C3B-98B1-4174-81B1-69B93F171039.jpeg
    75428C3B-98B1-4174-81B1-69B93F171039.jpeg
    99.1 KB · Views: 7

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
LIstcount starts at one, whereas the Listbox Index (List) starts at 0 so the - 1 is to make it start at the first position of the Listbox Index
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,984
Members
449,092
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top