offset problem

G

Guest

Good Morning!

Newbie here getting tired of the fight! I'm having a problem with
attempting to offset 1 cell to the right.

I've created a Loop Until statement based on a selectionchange, with If..
Then.. statement enclosed within the loop. My "Then" statements instructs a
value to be inserted in the cell to the right upon SelectionChange. This
part works well, however the curser remains in the cell where it just enter
the "Then" text. I want the curser to move one more cell to the right so the
user can continue with their data entry.

When I add "ActiveCell.Offset (0,1).select" either within the loop statement
or after it, my curser jumps WAY over (e.g. from column "H" to something like
"IU". A little excessive in my opinion!

I'm sure the computer is doing exactly what I'm telling it to do, however
that is not what I want it to do :)

Any help would be appreciated.

JJ
 
G

Guest

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On error goto Errhandler
Application.EnableEvents = False

' your current code

errhandler:
Application.EnableEvents = True
End Sub

you are recursively calling the selectionchange event by changing the
selection within the event.

this should fix it.
 
G

Guest

You don't have to select a cell to read the value.

cellvalue = ActiveCell.Offset (0,1).value
 

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

Similar Threads


Top