View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Macro to insert lines

I didn't see your master file. As you know, it worked fine on the file you
sent to me.
I also notice here that you left out the . 's in the with statement.

Task #12



--
Don Guillett
SalesAid Software

"tanyhart" wrote in
message ...

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