I am running a macro to add rows or remove rows assigned to a form button.
The problem is if the active cell is moved from the last blank row the marco
won't run.
Is it possible to have the macro alway return the cursor to the required
active cell before it runs?
May have been better if you had posed some of yout code but try something
like:
ActiveCell.End(xlUp).Offset(1, 0).Select

Signature
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
>I am running a macro to add rows or remove rows assigned to a form button.
> The problem is if the active cell is moved from the last blank row the
[quoted text clipped - 3 lines]
> Is it possible to have the macro alway return the cursor to the required
> active cell before it runs?
Without seeing your code it is hard to say why your macro won't run if
activecell is not in last blank row.
This will move the cursor to last blank cell in column A
Sub foo()
Dim rcell As Range
Set rcell = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Application.Goto Reference:=rcell
MsgBox "Activecell is" & rcell.Address
End Sub
Gord Dibben MS Excel MVP
>I am running a macro to add rows or remove rows assigned to a form button.
>The problem is if the active cell is moved from the last blank row the marco
>won't run.
>
>Is it possible to have the macro alway return the cursor to the required
>active cell before it runs?
MechEng - 24 Sep 2007 13:44 GMT
Thank you both. It is working great now.
I appreciate the help.
Dan
> Without seeing your code it is hard to say why your macro won't run if
> activecell is not in last blank row.
[quoted text clipped - 17 lines]
> >Is it possible to have the macro alway return the cursor to the required
> >active cell before it runs?