Listbox Dynamic Name Range VBA

Tades101

New Member
Joined
Feb 2, 2023
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone

I am using a Dynamic name range to populate my listbox in.

When I set my formulae to only 2 columns and to a certain range it keeps changing for some reason and my listbox gets populated by blanks.
Name range formulae:
=OFFSET(Sheet1!$R$243,1,0,COUNTA(Sheet1!$R$244:$T$265),2)

But it seems to be highlighting much more all the way down to Row 309:
1675583380162.png


Is there something I am doing wrong?

Thanks in advance.

Regards
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Assuming col R will always have data it should be
Excel Formula:
=OFFSET(Sheet1!$R$243,1,0,COUNTA(Sheet1!$R$244:$R$265),2)
 
Upvote 0
Assuming col R will always have data it should be
Excel Formula:
=OFFSET(Sheet1!$R$243,1,0,COUNTA(Sheet1!$R$244:$R$265),2)
Thank you
But how do I make the List to be dynamic, i.e. changes in number of rows will always only have not list blanks?

For example
The code I provided is referencing two column ranges, however I have a drop down list that populates those two columns with varying number of rows. The starting positions always remain to same just the number of rows vary. I want my list box to dynamically change and have no blanks whether one list is longer than the other if that makes sense?

Thanks
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,249
Members
448,556
Latest member
peterhess2002

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