Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default from menu Data-Validation, with List

Is there a way when cell selected with small arrow button that the list range
will allways show from the top of list range and not from last selection
within the list range
-
Jim at Eagle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default from menu Data-Validation, with List

lists generally show the selected item -- if you clear the cell, the the kist
will show the items top-down
You can use the selection change event to clear the cell.
In this example, cell B6 is data validated. When I select it, the event
fires, clearing the cell's value, making the list start from the first item

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$7" Then
Target.Value = ""
End If
End Sub

The following code is similar, but instead of clearing the cell, sets its
value to the first item in the list (range named 'MyList')- a default value
if you will:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Target.Address = "$B$7" Then
Set cell =
ActiveWorkbook.Names.Item("MyList").RefersToRange. Range("A1")
Target.Value = cell.Value
End If
End Sub


"Jim at Eagle" wrote:

Is there a way when cell selected with small arrow button that the list range
will allways show from the top of list range and not from last selection
within the list range
-
Jim at Eagle

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default from menu Data-Validation, with List

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
If Target.Address = "$B$2" Then
Set cell = ActiveWorkbook.Names. _
Item("Cus").RefersToRange.Range("A1")
Target.Value = cell.Value
End If

This will allways display the first name in my list named "Cus" never
allowing a change.
The code causes a lockup for about 6 sec.
The other code allways leaves B2 empty and appears to cycle for 2 sec.
because the cell is in the corner of the worksheet I might be able to place
a clear box under B2 so that when the mouse passes over it clears B2 or at
least selects first name in Cus list.
What do you think?


"Patrick Molloy" wrote:

lists generally show the selected item -- if you clear the cell, the the kist
will show the items top-down
You can use the selection change event to clear the cell.
In this example, cell B6 is data validated. When I select it, the event
fires, clearing the cell's value, making the list start from the first item

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$7" Then
Target.Value = ""
End If
End Sub

The following code is similar, but instead of clearing the cell, sets its
value to the first item in the list (range named 'MyList')- a default value
if you will:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Target.Address = "$B$7" Then
Set cell =
ActiveWorkbook.Names.Item("MyList").RefersToRange. Range("A1")
Target.Value = cell.Value
End If
End Sub


"Jim at Eagle" wrote:

Is there a way when cell selected with small arrow button that the list range
will allways show from the top of list range and not from last selection
within the list range
-
Jim at Eagle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default from menu Data-Validation, with List

Guess what happens when the mouse runs away.
I think were both using the same oar

"Patrick Molloy" wrote:

lists generally show the selected item -- if you clear the cell, the the kist
will show the items top-down
You can use the selection change event to clear the cell.
In this example, cell B6 is data validated. When I select it, the event
fires, clearing the cell's value, making the list start from the first item

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$7" Then
Target.Value = ""
End If
End Sub

The following code is similar, but instead of clearing the cell, sets its
value to the first item in the list (range named 'MyList')- a default value
if you will:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Target.Address = "$B$7" Then
Set cell =
ActiveWorkbook.Names.Item("MyList").RefersToRange. Range("A1")
Target.Value = cell.Value
End If
End Sub


"Jim at Eagle" wrote:

Is there a way when cell selected with small arrow button that the list range
will allways show from the top of list range and not from last selection
within the list range
-
Jim at Eagle

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
Data-Validation -List - Pick from a drop down menu kay Excel Discussion (Misc queries) 4 July 8th 08 09:06 PM
Create Dropdown menu without using the Validation on the Data Menu lostinformulas Excel Worksheet Functions 0 July 13th 06 08:47 PM
Drop-down menu in validation list too wide!? Joe HM Excel Programming 0 March 29th 05 08:43 PM
Drop-down menu in validation list too wide!? Joe HM Excel Programming 0 March 29th 05 08:40 PM
How do I set up a drop down menu for a validation list? UisNike Excel Worksheet Functions 2 December 29th 04 07:13 PM


All times are GMT +1. The time now is 05:19 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"