Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Old, working macro now stops partway (without error) after Selection.Insert
(Excel 2000) I have a worksheet I've been using for 11 years, but a year or
two ago, one of my macros started misbehaving. I've managed manually since then, but decided to revisit the problem. The macro creates a copy of the last data row in my sheet, pastes it below, then populates the cells with the defaults I need for a new data row. The problem: the macro now exits after successfully pasting the copied row - the . No error is displayed, but the following statements are not executed. If I step through the macro in debug mode, once the Selection.Insert statement is executed, the yellow "current statement" arrow disappears and pressing F8 again starts execution at the top of the macro. Do you have any idea why my previously-solid macro is behaving this way? Here's the top part of the code. Thanks, Charles __________ Sub New_row() Dim CellAboveTotal As Range, MyRow As String ' Duplicate last row (above total) Application.Goto reference:="First_blank_row" Selection.Cells(1, 1).Activate ActiveCell.Offset(-1, 0).Rows("1:1").EntireRow.Select Selection.Copy ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select Selection.Insert Shift:=xlDown ' Leave these cells as duplicates of previous entry: Project, Stage, Task ' Paste current date in Date cell, and current time in Start Time cell Cells(ActiveCell.Row, DateColumn).Select Call Paste_date(Date) ' Remember: moves one cell to the right ActiveCell.Offset(0, 1).Select Call Paste_time(Now) ' Remember: moves one cell to the right ' Clear End Time cell ActiveCell.ClearContents ' Status should be "New" Cells(ActiveCell.Row, StatusColumn).Value = "New" [code continues...] __________ In Debug, all values are defined, e.g. First_blank_row = 983:983, DateColumn = 5, StatusColumn = 11. (Undefined values would generate errors, anyway, and no errors appear.) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro stops working when sheet is protected | Excel Discussion (Misc queries) | |||
Macro to insert data from another sheet stops working | Excel Programming | |||
macro randomly stops working | Excel Programming | |||
After sharing workbook VB code stops working. Runtime Error 1004 | Excel Programming | |||
overflow error 6.. the macro just stops any idea why? | Excel Programming |