impossible to change the activecell???

J

John T Ingato

I have a function which analyzes the active cell, offsets it by one, and
loops this way until it find an empty cell. Its my version of finding the
end of a contiguous range. It work well in almost every condition, but it
appears that when it is called from a particular function, the activecell
cannot be offset.

The calling code does nothing more then call the function, just like any
other function

Does anyone know of a condition where the activecell is locked?


THIS IS THE CALLING FUNCTION
Private Sub ListOfRepsBox_Click()

UpdateStores

If Me.MultiPage1.Value = 1 Then Me.StoreEntry.SetFocus

End Sub


THIS IS THE LOOP
ElseIf Selection = "col" Then

Do While Not IsEmpty(ActiveCell)

ActiveCell.Offset(NextCell, 0).Select
Count = Count + 1

Loop

If Count > 1 Then ActiveCell.Offset(-1, 0).Select

End If
 
N

Nikos Yannacopoulos

Finding the end of a continuous renage is a hell of a lot
easier and faster by using:

Selection.End(xlToRight).Select
or xlTo Left, xlUp, xlDown...

Give it a shot.

Nikos Y. (nyannaco at in dot gr)
 

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