Short VBA for Excel question - copy to end

  madwab 13:47 28 Oct 2004

If I right click on a tab I can copy or move it to the end; however if I do this while recording a macro, the generated code doesn't copy to the end, it copies after a named tab which happens to be the last tab in that instance, so the code isn't portable.

Anyone know the syntax to replace the code below so that it will always copy s3 to be the last tab of b2, no matter how many tabs b2 has?

Sheets(s3).Copy After:=Workbooks(b2).Sheets(3)


  VoG II 14:05 28 Oct 2004

Sheets.Add.Move after:=Sheets(Sheets.count)

  VoG II 14:26 28 Oct 2004

Didn't read the question.

Sheets("S3").Move after:=Sheets(Sheets.count)

  madwab 15:38 29 Oct 2004

Much appreciated - wish the help file was as helpful!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

Adobe shows still-in-development tools, including automatically colourising black-and-white photos

iPhone X news: Release date, price, new features & specs

Comment transformer un iPhone en borne Wi-Fi ?