If the entries will all be text, define a name with this formula:
=OFFSET(Sheet1!$K$1,0,0,COUNTIF(Sheet1!$K:$K,">a"),1)
and use that name as the data validation source.
If there will be numbers mixed in the external list, you can use Count.
=OFFSET(Sheet1!$B$1,0,0,COUNTIF(Sheet1!$B:$B,">a")+COUNT(Sheet1!$B:$B),1)
ssGuru wrote:
> Thanks Garys Student who said:
>
>>Suppose you have a list which, as the result of linking or calculation, may
>>have blanks in it.
>>For example A1 thru A30:
>>word1
>>word2
>>
>>word7
>>word8
>
>
> Basic problem Garys Student is that Data Validation will ONLY use a
> local named range.
>
> Maybe I didn't make my question clear enough. I DON'T have
> intermittent blanks mixed in the presorted lookup table in the
> EXTERNAL workbook. That is a no no and LOOKUP on such a table would
> fail anyway. My external table column K, ONLY has data starting at
> row2 after the header, NO formulas, and the table is automatically
> sorted by code when new data is added.
>
> Data Validation if set on this whole column would also shows blanks in
> its dropdown. But, telling Data Validation to look to a subset of this
> column that ONLY contains data makes it display only values in the
> dropdown and no blanks. So far so good. This formula for a
> restricted named range successfully does that. =Lists!$K
> $1:INDEX(CompetitorList,COUNTA(CompetitorList)) WHEN USED LOCALLY IN
> THE EXTERNAL WORKBOOK for local Data Validation.
>
> My PROBLEM is that I am trying to apply that same logic to an internal
> worksheet in another workbook where col K between the two workbooks is
> mirrored into a local worksheet by the following If Then formulas and
> THEN use this internal range column for my Data Validation to keep it
> happy.
>
> Cells in col K in the internal worksheet that visually appear as empty
> actually have the formula =IF([DDLists.xls]DDLists!K5<>"",
> [DDLists.xls]DDLists!K5,"") Data Validation works against this
> column just fine but of course there are now cells with a "" rather
> than just being NULL so it also displays all the blank cells in the
> dropdown. Bummer.
>
> I need to change EITHER of these two formulas to give Data Validation
> a list that ONLY contains data and not "" or come up with a different
> plan.
>
> The mirror formula =IF([DDLists.xls]DDLists!K5<>"",
> [DDLists.xls]DDLists!K5,"") could be changed to give a NULL value
> instead of "" in some way. "0" won't work.
>
> OR the formula below which defines a named range to stop counting when
> it reaches a "" value in col K.
> FORMULA: NameDefined RANGE for "CompetitorListRec"
> =Lists!$K$1:INDEX(CompetitorList,COUNTA(CompetitorList))
>
> Maybe change COUNTA(If(CompetitorList<>"",COUNTA, Don't count???
>
> I can't use the external table INDEX to restrict the named range list
> such as =Lists!$K
> $1:INDEX([DDLists.xls]CompetitorList,COUNTA([DDLists.xls]CompetitorList))
> because Data Validation DEMANDS an internal table. It is confusingly
> quite happy thinking that data in a cell that has a formula that
> results in getting data FROM an external table is an internal
> worksheet with internal values.
>
> Perhaps I can add code that checks the external table and when it
> grows to add the mirror If Then formula to a corresponding cell in col
> K in the internal worksheet. There must be a simpler way.
>
> Thanks for any help or advice,
> Dennis
>
--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html