by the way, in my previous post
1. the code started the range in A4 and not A3 as i said:
"=OFFSET(Sheet1!$A$4...
to start it in A3, use
"=OFFSET(Sheet1!$A$3...
2.i built a DYNAMIC named-range, ie when you add a row of data, the range
referenced by the named range is automatically adjusted. Eg
Say the named range references A3:A100
Add data in A101
The range now references A3:A101
This due to the formula-type definition.
Maybe you just needed a fixed named range:
To create a fixed named range, assuming you don't know where data stop in
column A, use something like:
Dim Addr as string
Addr = "=Sheet1!$A$3:" & ActiveWorkbook.Worksheets("Sheet1").Range( _
"A65536" ).End(xlUp).Address(True,True,xlA1)
ActiveWorkbook.Names.Add Name:="MyName", RefersTo:= Addr
In this last case, assuming you have data in A3:A100, the code sets the
named range to A3:A100
Now if you add a row in A101, the named range is NOT automatically adjusted.
You need to re-run the code to reajust it.
That is the difference between dynamic and fixed named range.
Regards,
Sebastien