Cell has focus but no indication that it does.

J

Jacob

Hi all,

When in a cell, MS Excel will put a double border around it to show
that the cell has focus. However, for some reason the double border
disappears when VBA code is run (Worksheet_Change or Worksheet_
SelectionChange events), even if nothing is done to the cell in the
VBA code. There are times that other worksheets are modified during
this code execution, but after those executions of the code, the
double border does appear. It seems to disappear when nothing is done
in the code that affects the current cell.

In the code, I do unprotect the workbook and one or more worksheets,
then protect them again. But when stepping through the code, I could
not recreate the problem.

It is an intermittent problem, so I am wondering if this is a speed/
processing issue? I am running on a Core Duo processor with plenty of
RAM.

Any help is appreciated.

Jacob
 
J

JLGWhiz

Hi Jacob,
I would have to see the code to be sure, but maybe I can explain it. If you
use cell.Select or cell.Activate then the border should appear. However if
you use cell = cell2.Value it will enter the value in cell but will not
produce the border. In short, it depends on how the code is written whether
the cusor (cell border) is moved or not. It basically moves with Select and
Activate. If you write the code for direct value assignments, or conditional
value assignments, you probably will not see the cursor move.
 
J

Jacob

Thanks for the reply. I simply added selection.activate in the sheet-
selectionchange event of the workbook and that does it. of course, it
stops any easy copy/paste, but in this instance, that is ok.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top