Hi Werner,
Using relative names with A1 notation can be very confusing.
I strongly recommend using R1C1 notation (ReferstoR1C1) when
creating/looking at relative names: it is much easier to work out whats
happening.
Charles
__________________________________________________
The Excel Calculation Site
http://www.decisionmodels.com
"Werner Rohrmoser" <werner-(E-Mail Removed)> wrote in message
news:8f72c6a3-11e9-4076-94cc-(E-Mail Removed)...
> Hello,
>
> I'm using a For Next loop to create some named formulas.
>
> *****************************************************************
> For LoopCounter = 11 To 18
> ThisWorkbook.Names.Add Name:=Service.Cells(LoopCounter, 1).Value, _
> RefersTo:=Service.Cells(LoopCounter, 2).Value
> Next LoopCounter
> *****************************************************************
>
> the RefersTo arguments looks like this:
> "ABS(C$173-SUM(C$158,C$165,C$168))<1" (columns relative)
>
> When I run my procedure having cell pointer on column"C" I get
> named formulas, which looks like this:
> "ABS(E$173-SUM(E$158,E$165,E$168))<1" (offset of two rows).
>
> When I use column"A" in the RefersTo argument I get column "C" in my
> named formulas.
>
> CRAZY!
>
> Any help is appreciated.
> Excel XP SP3
> WIN XP SP1
>
> Best Regards
> Werner