Excel 2007 (Beta) - strange behavior of macro
When I run this in Excel 2003 it just creates 2 names "_gyoz" and "_yusho",
possibly because the code you posted never defines "Nev". I'd suggest that
you rework your example and post it here if that behaves differently in the
Excel versions.
--
Jim
"András" wrote in message
...
|I have written a small macro which gives names to cells. It ran fine in
Excel
| 2003, but behaves strange in 2007 beta.
|
| For sor = 2 To 43
| Name = Cells(sor, 1)
|
|
| Cellanev1 = "=Rikishi!R" & sor & "C17"
| ...
| Cellanev11 = "=Rikishi!R" & sor & "C29"
|
|
| Ujnev1 = Nev & "_gyoz"
| ...
| Ujnev11 = Nev & "_yusho"
|
|
| Cells(sor, 17).Select
| ActiveWorkbook.Names.Add Name:=Ujnev1, RefersToR1C1:=Cellanev1
| ...
| Cells(sor, 29).Select
| ActiveWorkbook.Names.Add Name:=Ujnev11, RefersToR1C1:=Cellanev11
|
| Next sor
|
|
| For being shorter, I deleted some lines, but I think it's clear this way,
| too. So, in Excel 2003 it ran fine through the lines ("sor") and gave name
to
| each cell. But now, in 2007, the macro runs, and gives name to the first
| given cell, and leaves the rest. If I run it again, it names the second
cell.
| A third run results a name for the third cell, etc. When I run the macro
from
| VBA Editor step by step with F8, then it does its job fine. Any solution?
Or
| is it simply a bug of beta? Hm, well, I sincerely hope they have fixed it
in
| the final version.
|