Dropdown

shyamvinjamuri

Board Regular
Joined
Aug 2, 2006
Messages
175
Hi

I have a dropdown in Sheet1 column A which has names which increase or decrease.
Is there a way to show the names based on the last filled row in Column A?

Thanks
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi

I have a dropdown in Sheet1 column A which has names which increase or decrease.
Is there a way to show the names based on the last filled row in Column A?

Thanks
Do you mean that you want a dynamic range?

Maybe something like this...

Names in the range A2:An

=A2:INDEX(A2:A1000,MATCH("zzzzz",A2:A1000))

Adjust for a reasonable end of range.
 
Upvote 0
Thanks.

What I am looking for is this.
Instead of A2:A1000, A2:A(last filled row in column A)
Last filled row is dynamic. it could be any number.

Thanks
 
Upvote 0
You could also use some Code in the sheet to change the Named Range each time the column of names change. Name the Range you have your column of names and set the listfillrange in the properties of the pulldown box to be that named range. Add the code below to the sheet. Of course you can change the location where the names are stored.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim i As Range, R As Range
  Set i = Intersect(Target, Range("B1:B1000"))
  
  If Not i Is Nothing Then
    Application.EnableEvents = False
    Set R = Sheets("Sheet1").Range(Range("B1"), Range("B65000").End(xlUp))
    ActiveWorkbook.Names("Names").RefersToR1C1 = R
    Application.EnableEvents = True
  End If
  
End Sub
 
Upvote 0
Thanks.

What I am looking for is this.
Instead of A2:A1000, A2:A(last filled row in column A)
Last filled row is dynamic. it could be any number.

Thanks
Ok, that's exactly what my suggestion will do.

It's creating a smaller dynamic range from a larger range. The A1000 refers to the end of the larger range. Just adjust that so the formula isn't wasting "its time" looking in a bunch of empty cells for something that doesn't exist.

For example, if you know for certain that the number of names in the range will never be more than 100, then use A100 as the end of the larger range:

=A2:INDEX(A2:A100,MATCH("zzzzz",A2:A100))

MATCH("zzzzz",A2:A100) will find the last TEXT entry in the range A2:A100. Let's assume that last TEXT entry is in cell A59. Then the formula returns the dynamic range A2:A59.
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,421
Members
452,913
Latest member
JWD210

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