PDA

View Full Version : Solved: someCell.activate and then showing up on screen



Koesper
02-06-2006, 07:02 AM
Hi,
i'm building a tool thatl loops through each cell in the workbook, but i want a cell that is actually activated to also show up on the screen, so the user sees what cell has just been activated.

i thought that just activating the cell would be enough

for each theCell in activeSheet.usedrange.cells
if theCell.value="something" then
theCell.activate
end if
next

but if i do something like this, the cell IS activated, but the user doesnt see anything happening on screen If that cell is not currently visible on the screen.
this means that the user has to scroll down and stuff, instead of the activated cell being brought up for him to see.

is that supposed to happen?
or is there something like
theCell.GetFocus

or have i screwed something up with application.screenupdate=false or something like that

:dunno

thanx in advance!

Killian
02-06-2006, 07:27 AM
or have i screwed something up with application.screenupdate=false or something like that

If you've used "application.screenupdate=false" then the screen won't update until you set it to True or exit the procedure you used it in.

Koesper
02-06-2006, 07:55 AM
Ah... it did have to do with the screenupdating=false,
but i thought it wouldnt because i did

application.screenupdating=false
doSomething(theCell)
theCell.activate
application.screenupdating=true

but after you set the screenupdating back to true, it doesnt try to refocus to the active cell...
so if i just change the order to:

application.screenupdating=false
doSomething(theCell)
application.screenupdating=true
theCell.activate

the problem is solved...

so perhaps i was already looking in the right direction, but i guess i just needed the nudge to look further :-)

thanx anyway!