ComboBox query - why lots of blank rows?

manc

Active Member
Joined
Feb 26, 2010
Messages
340
Good morning,

Workbook A Sheet 1 contains four columns
A = concatenate B & C
B = first name
C = cast name
D = phone number

The CONCATENATE formula in column A replicates down to line 50, as i can't be sure how many contacts there will be, but i do know that there won't be more than 50.

Workbook B Sheet 'Contacts' contains a query to fetch the data from Workbook A Sheet 1 on startup and displays the data in the same format as the source worksheet.

Workbook B Sheet 'Main' then contains a ComboBox that fetches data from column A from Workbook B 'Contacts' sheet.

However, the ComboBox has lots of blank rows.
How do i get rid of these?

The ComboBox is populating from a data validation drop-down list in A1 - courtesy of Contextures code that enables a ComboBox to appear when you double-click on a cell that contains a data validation drop-down list.

The data validation list source is '=CONTACTS'
Within Name Manger, CONTACTS is defined as a dynamic range =OFFSET(CONTACTS!$A$1,0,0,COUNTA(CONTACTS!$A:$A),1)
(However, when you select the range in name manager, the range is showing down to row 50 - should it not highlight the whole column? I can't see where i am referencing it only down to row 50??)

I've tried deleting the CONCATENATE formula in original source workbook from the rows that do not contain any data, just to see, but it made no difference.

Any ideas much appreciated. Whilst not the end of the world and is workable, it is just one of these frustrating issues that i am sure is easy to sort if you know how.

Best regards
manc
 
Steve,

I did this:
=OFFSET(CONTACTS!$A$1,0,0,SUMPRODUCT(--(CONTACTS!$A$1:$A$50<>" ")))
and it is now only showing 2 blank rows!
No idea why!

Best regards
manc
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Steve,
If i change the formula to this
=OFFSET(CONTACTS!$A$1,0,0,SUMPRODUCT(--(CONTACTS!$A$1:$A$48<>" ")))
there are no blank rows - everything is as it should be.
I'm now going to add the formula back to the original source file down to row 48 and see what happens.

Best regards
manc

***update***
I can add names to the source file, close and exit it.
The other workbook i can open and display the combobox with no blank rows and it displays newly added rows.
Formula used in name manager, named CONTACTS
=OFFSET(CONTACTS!$A$1,0,0,SUMPRODUCT(--(CONTACTS!$A$1:$A$48<>" ")))
Data Validation List = CONTACTS

Thank-you very much for your advice, help and knowledge Steve - much appreciated.

Best regards
manc
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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