Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

LoopCount = Range("Cell_LoopCount").Value

share|improve this answer
    
OK, I'm checking into the Serious Bonehead Treatment Center as soon as they have an opening. Thanks. –  Fred Hamilton Feb 25 '10 at 0:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.