impossible to change the activecell???
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)
-----Original Message-----
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
.
|