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.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

VFX Oscar nominees 2017: Discover how the visual effects were created

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…