Hi,

I have been using some VBA code to define and name ranges when a workbook is opened, but I've come to a dead end with one of the Dynamic Lists, just wandering if the following line could be converted to "VBA"?
It refers to a Dynamic list called "VendorListDynamic", with sheets called "vendor" and "partslist".

=OFFSET(vendor!$A$2,0,0,COUNTA(partslist!$A:$A),11)
and this is an example of the other code that I am using to name the ranges, this one defines a range and names is "suppliercostslist", using the Sheet "VendorInCosts".

Sub supplierdefine1()
With Workbooks("company.xlsm").Sheets("VendorsInCosts")
Sheets("VendorsInCosts").Activate
.Range("A1").Select
Dim rng As Range
Sheets("VendorsInCosts").Activate
Sheets("VendorsInCosts").Range("A1").Select
Set rng = Range("A1:A" & Sheets("VendorsInCosts").Range("A65535").End(xlUp).Row + 1)
ActiveWorkbook.Names.Add Name:="suppliercostslist", RefersTo:=rng
Application.ScreenUpdating = True
End With
End Sub
thanks for any help

Graham