Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default sorting a dropdown list automatically

I can do a dropdown list for the whole column of data but i need when i press
on the dropdown list to see the data in sorted way because the column where i
am taking the dropdown list from is editable column
Best regards
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default sorting a dropdown list automatically

Mohammed,

There isn't an action for the before entry to a drop down list.

A possible solution is to sort the data entry column after a change, her
I've assumed it was column A.:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Me.Range("A:A"), Target) Is Nothing) Then
' need to modify to meet your requirments
Me.Range("A:A").Sort Key1:=Me.Range("A1")
End If
End Sub

You need to modify the sort to meet your requirments.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Mohammed" wrote:

I can do a dropdown list for the whole column of data but i need when i press
on the dropdown list to see the data in sorted way because the column where i
am taking the dropdown list from is editable column
Best regards

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default sorting a dropdown list automatically

Assuming source data is in A1 down in Sheet1, with data comprising unique
numbers only with possible blank cells or formula cells returning null
strings in-between, here's one way ..

Put in B1: =IF(A1="","",A1)
Put in C1: =IF(ROW()COUNT(B:B),"",SMALL(B:B,ROW()))

Select B1:C1, copy down to cover the max extent of data in col A.
Col C will return an auto-ascending sort of the numbers in col A.

Click Insert Name Define,
enter under
Names in workbook: MyList
Refers to:
=OFFSET(Sheet1!$C$1,,,SUMPRODUCT(--(Sheet1!$C$1:$C$1000<"")))
Click OK

Note: Adjust the sumproduct range above to suit the max expected extent in
col C. Use the smallest range large enough to cover.

Now in any sheet of the book, we can create DV lists using MyList as the
source for the data validation. Test it out. In any sheet, select the desired
DV range, then click Data Validation. Under Allow, choose: List. In the
"Source" box, put: =MyList. Click OK. The DV dropdown will display the
required auto-ascending sort of the source data in Sheet1's col A.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mohammed" wrote:
I can do a dropdown list for the whole column of data but i need when i press
on the dropdown list to see the data in sorted way because the column where i
am taking the dropdown list from is editable column
Best regards

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default sorting a dropdown list automatically

The DV dropdown will display the required auto-ascending
sort of the source data in Sheet1's col A.


The DV dropdown list will display neatly only the full range of the sorted
numbers, w/o any blanks
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown list connected to another workbook Pieman Excel Worksheet Functions 5 March 12th 06 09:35 PM
dropdown list cardingtr Excel Discussion (Misc queries) 5 March 2nd 06 03:44 PM
Can I import a folder's contents as a dropdown list? Terp Excel Worksheet Functions 2 August 23rd 05 06:35 PM
Automatically sorting data leehutch Excel Discussion (Misc queries) 4 August 22nd 05 06:36 AM
How to show dropdown list from another workbook without running it Kuche Excel Discussion (Misc queries) 1 June 29th 05 07:05 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"