Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does this macro stop in the middle without an error?

Status
Not open for further replies.

qjd2004

Technical User
Feb 2, 2004
80
GB
Hi,

got a macro and it exits for no reason.

Code:
Public Sub Extracter()

    Selection.Copy
    Application.Workbooks.Add.Activate
    Worksheets("Sheet1").Paste      'IT JUST STOPS HERE!
    Worksheets("Sheet1").Name = "Source"
    Selection.Copy
    Sheets("Sheet2").Activate
    ActiveSheet.Paste

Exit Sub

Why Does it exist on line 5 without an error?

Can anyone help me please?
 
qjd2004,

works fine for me. it creates another workbook and puts the data in it. am i missing something?

regards
longhair
 
Shouldn't that be 'End Sub', not 'Exit Sub' at the end?
 
Hiya,

It seems to be working ok. Sorry! I don't know why it wasn't before???

Should be End Sub that was typ-o

Cheers anyway guys.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top