Dependent drop down dynamic range formula, off sheet.
Hi again,
Am Fri, 19 Dec 2014 10:04:47 +0100 schrieb Claus Busch:
the depending list must have a fix range. It will not work with dynamic
range names
if you want dynamic names in CSI_DETAILED you have to do it with VBA.
In a standard module:
Sub myNames()
Dim LCol As Long, LRow As Long
Dim i As Long
With Sheets("CSI_DETAILED")
'Counts the columns in row1. Modify to suit
LCol = .Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To LCol
LRow = .Cells(Rows.Count, i).End(xlUp).Row
ThisWorkbook.Names.Add .Cells(1, i), _
RefersTo:=.Range(.Cells(2, i), .Cells(LRow, i))
Next
End With
End Sub
In sheet module of sheet "CSI_DETAILED":
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:J100")) Is Nothing _
Then Exit Sub
Call myNames
End Sub
If you change the data in sheet "CSI" the macro myNames will run and
change the range of the names
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
|