Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro stops working when sheet is protected RefLib1978 Excel Discussion (Misc queries) 3 May 28th 09 03:57 PM
Macro to insert data from another sheet stops working Nats Excel Programming 1 September 3rd 06 11:30 PM
macro randomly stops working johnlengacher Excel Programming 1 February 2nd 06 06:44 PM
After sharing workbook VB code stops working. Runtime Error 1004 Patrick LaFerriere Excel Programming 0 October 5th 05 04:01 PM
overflow error 6.. the macro just stops any idea why? ste mac Excel Programming 4 February 7th 05 04:00 PM


All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"