R Rick Rothstein \(MVP - VB\) Feb 5, 2008 #2 I think you may have to provide us with a more detailed description of what you are trying to do. Rick
I think you may have to provide us with a more detailed description of what you are trying to do. Rick
B Bob Phillips Feb 5, 2008 #3 Dim StartLine As Long With ActiveWorkbook.VBProject.VBComponents("Module1").CodeModule StartLine = .CountOfLines + 1 .InsertLines StartLine, _ "Sub TestProc()" & vbCrLf & _ "Dim ans" & vbCrLf & _ " ans = Msgbox( ""All OK"",vbYesNo)" & vbCrLf & _ " If ans = vbNo Then Cancel = True" & vbCrLf & _ "End Sub" End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy)
Dim StartLine As Long With ActiveWorkbook.VBProject.VBComponents("Module1").CodeModule StartLine = .CountOfLines + 1 .InsertLines StartLine, _ "Sub TestProc()" & vbCrLf & _ "Dim ans" & vbCrLf & _ " ans = Msgbox( ""All OK"",vbYesNo)" & vbCrLf & _ " If ans = vbNo Then Cancel = True" & vbCrLf & _ "End Sub" End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy)
T thread Feb 6, 2008 #5 All explained nicely here:http://www.cpearson.com/excel/vbe.aspx RBS -הר××” טקסט מצוטט- Click to expand... thank you very much
All explained nicely here:http://www.cpearson.com/excel/vbe.aspx RBS -הר××” טקסט מצוטט- Click to expand... thank you very much