Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
May have been better if you had posed some of yout code but try something
like: ActiveCell.End(xlUp).Offset(1, 0).Select -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "MechEng" wrote in message ... 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? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 On Sat, 22 Sep 2007 12:36:00 -0700, MechEng wrote: 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? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you both. It is working great now.
I appreciate the help. Dan "Gord Dibben" wrote: 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 On Sat, 22 Sep 2007 12:36:00 -0700, MechEng wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create a macro that references the currently active cell | Excel Worksheet Functions | |||
macro- move down to empty cell & active worksheet | Excel Worksheet Functions | |||
Update Macro: Leave Colour As Before Once Cell is Not Active | Excel Discussion (Misc queries) | |||
keep active sheet view and cursor position | Excel Worksheet Functions | |||
Relative Cell position NOT working with or without macro | Excel Discussion (Misc queries) |