View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Grd Grd is offline
external usenet poster
 
Posts: 118
Default Three lines of code that I can't understand

Hi,

I'm having trouble with my code. It works when I step through it but not
otherwise.
So I'm trouble shooting the references with Debug.Print.

Heres a couple of lines that I find inexplicable. They are right ontop of
each other as I've put them below:

Debug.Print "starting " & theStartingCell.Address
theStartingCell.Interior.Color = vbRed
Debug.Print "starting " & theStartingCell.Address

The results in the immediates window are "starting $A$5" for both
debug.print lines which is as expected.
However when running it it makes $a$6 red in colour. When stepping through
it makes $a$5 red in color.

How could the reference change from one line to another. The code is in a
module if thats pertinent.

I'm totally confused as to how this could be possible

Any guidance would be greatly appreciated

Thanks
Suzanne