View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
tanyhart[_15_] tanyhart[_15_] is offline
external usenet poster
 
Posts: 1
Default Macro to insert lines


Thanks again for your help.

When I enter the Code into my master file, I get a run-time error '13'
Type mismatch on the line beginning mynum =

Sub addtasks()
Application.DisplayAlerts = False
myrow = Cells.Find("Total P&C Estimate").Row - 3
mycell = Cells(myrow, 2)
mynum = Right(mycell, Len(mycell) - InStr(mycell, "#")) + 1

With Range(Cells(myrow, 2), Cells(myrow + 2, 2))
EntireRow.Copy
EntireRow.Insert Shift:=xlDown
End With

Application.CutCopyMode = False
Cells(myrow + 3, 2) = "Task#" & mynum
Application.DisplayAlerts = True
End Sub


--
tanyhart
------------------------------------------------------------------------
tanyhart's Profile: http://www.excelforum.com/member.php...o&userid=35148
View this thread: http://www.excelforum.com/showthread...hreadid=549504