Excel 2003 macro doesn't see named cell

4

I'm trying to clean up an excel macro where I was referencing cells directly ("LoopCount = Range("E4").Value") instead of using named cells ("LoopCount = Cell_LoopCount").

  • So I named cell E4 "Cell_LoopCount". Its label is right there in the upper left corner whenever I select cell E4.
  • At the beginning of the macro, I added "Sheets("Data").Select" to make sure I'm operating on the right worksheet,
  • But breaking after "LoopCount = Cell_LoopCount" reveals Cell_LoopCount is empty and LoopCount = 0
  • "LoopCount = Range("E4").Value" still works fine

What obvious thing am I missing?

Fred Hamilton

Posted 2010-02-24T23:33:10.643

Reputation: 2 010

Answers

4

LoopCount = Range("Cell_LoopCount").Value

Lance Roberts

Posted 2010-02-24T23:33:10.643

Reputation: 7 895

OK, I'm checking into the Serious Bonehead Treatment Center as soon as they have an opening. Thanks. – Fred Hamilton – 2010-02-25T00:53:56.990