Counting Columns in Dynamic Range

E

ExcelMonkey

I have a Dynamic Named Range "DynamicSeedRow". I know that it span
from D1 to E1 (i.e. two columns)

I am tyring to pass the number of columns to a variable

Dim DataFieldRank As Integer
DataFieldRank = Range("DynamicSeedRow").Columns.Count

I keep getting Error 1004 Method range of Object _Global Failed.

What am I doing wrong?


Thank
 
F

Frank Kabel

Hi your code works if the name is defined for the active workbook. So
you may check (again) your name definition
 
Top