Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Dynamic Data Validation

I found the example on Debra Dalgliesh's
site(http://www.contextures.on.ca/DataValListAddSort.zip) does exactly what I
am after... (see my edits to the code below)

.....but I want to do the same thing for TransfersList located in column C
with target colum 10

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("validation")
If Target.Column = 17 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Dx List"), Target.Value)
Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("D" & i).Value = Target.Value
ws.Range("DxList").Sort Key1:=ws.Range("D2"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Dynamic Data Validation

There's another sample file that updates multiple source lists:

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'DV0021 - Update Multiple Validation Lists'

tmirelle wrote:
I found the example on Debra Dalgliesh's
site(http://www.contextures.on.ca/DataValListAddSort.zip) does exactly what I
am after... (see my edits to the code below)

....but I want to do the same thing for TransfersList located in column C
with target colum 10

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("validation")
If Target.Column = 17 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Dx List"), Target.Value)
Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("D" & i).Value = Target.Value
ws.Range("DxList").Sort Key1:=ws.Range("D2"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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
Dynamic Data Validation List Ken G. Excel Discussion (Misc queries) 2 February 1st 07 06:15 AM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Show do I share a dynamic list for data validation? KarenF Excel Discussion (Misc queries) 16 August 1st 06 10:51 PM
Dynamic Range, Data Validation and Address, Match and Offset Funct rudawg Excel Worksheet Functions 3 January 29th 06 03:19 AM


All times are GMT +1. The time now is 05:44 AM.

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"