Short VBA for Excel question - copy to end

  madwab 13:47 28 Oct 04
Locked

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)

Thanks

  VoG II 14:05 28 Oct 04

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

  VoG II 14:26 28 Oct 04

Didn't read the question.

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

  madwab 15:38 29 Oct 04

Much appreciated - wish the help file was as helpful!

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

Surface Pro (2017) vs Surface Pro 4

20 groundbreaking 3D animation techniques

How to mine Bitcoin on Mac