how to set activecell?

L

ljb

I have a worksheet_change event function that behaves differently based on a
value typed into a cell verses pasted into a cell. If I paste in a value the
activecell doesn't change. If I type a value and hit enter the activecell
moves down one row. How can I set the activecell to be the one I just moved
from?

thanks
LJB
 
H

Harald Staff

Hi

One brutal way is

Private Sub Worksheet_Change(ByVal Target As Range)
'whetever here, and finally:
Target.Select
End Sub

But whether the cursor moves on Enter or not is really the choice of each user, defined in
the Tools > Options > Edit > Move cursor after entry. And user preferences should in my
opinion be overridden only when absolutely necessary ... that is when the users are idiots
.... which is almost always ...<bg>
 
L

ljb

Thanks, got me going again.

Looking at help I find it suggests using Target.Activate if its a single
cell over Target.Select. Both seem to work for me.

thanks
LJB
 

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