Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Dinamic Validations Lists

Hi I am using in the Validation the formula :
=OFFSET(INDIRECT(SUBSTITUTE($A40,"
","")),0,0,COUNTA(INDIRECT(SUBSTITUTE($A40," ","")&"Col")),1)

And also I am using the next code for letting add new elements to my lists :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aux As String
Dim i As Integer
Dim allowedVal As Boolean
On Error Resume Next
Dim ws As Worksheet
Dim rngDV As Range
Dim rng As Range

'Add items to list
If (Target.row = 13 And Target.row <= 31) And (Target.Column = 12 Or
Target.Column = 15 Or Target.Column = 18 Or Target.Column = 21 Or
Target.Column = 24 Or Target.Column = 27 Or Target.Column = 30 Or
Target.Column = 33 Or Target.Column = 36 Or Target.Column = 39) Then
If Target.count 1 Then Exit Sub
Set ws = Worksheets("DATA-GEx Data")
If Target.row 1 Then

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo 0
If rngDV Is Nothing Then Exit Sub
If Intersect(Target, rngDV) Is Nothing Then Exit Sub
Set rng = ws.Range(ActiveWorkbook.Sheets("Part Appl
Guidelines").Cells(Target.row + 27, 1).Value)
If Application.WorksheetFunction.CountIf(rng, Target.Value) Then
Exit Sub
Else
i = ws.Cells(Rows.count, rng.Column).End(xlUp).row + 1
'we need to resize the range
ws.Cells(i, rng.Column).Value = Target.Value

Set rng = ws.Range(ActiveWorkbook.Sheets("Part Appl
Guidelines").Cells(Target.row + 27, 1).Value)
'With Worksheets("DATA-GEx Data").Range("J" & Trim(Str(row))).Font
' .ColorIndex = 3
' .Size = 10
' .Bold = False
'End With
rng.Sort Key1:=ws.Cells(1, rng.Column), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If
End If

But when I add a new element to the list ... the element is added but the
range is not being resized , I think so because it is letting to add the same
element more than once.

Could you please help me ?

Regards
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
how do I add in a dinamic graph the total as a new series? Guillermo Fuenzalida Charts and Charting in Excel 3 November 24th 07 05:53 AM
Dinamic sheet in web format Marcos Charts and Charting in Excel 0 March 10th 06 06:34 PM
Linking a dinamic cell value from one sheet to another KT Excel Discussion (Misc queries) 1 July 17th 05 12:53 AM
countif, dinamic criteria Stan Altshuller Excel Worksheet Functions 2 December 8th 04 08:22 PM
Excel error using Dinamic Table Iván Excel Worksheet Functions 0 November 30th 04 12:37 PM


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