Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default macro to copy last sheet in workbook

I need a macro to copy the last sheet in my workbook and put the copy at the
very end of the workbook, in effect it becomes the new last sheet. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default macro to copy last sheet in workbook

Option Explicit
Sub testem()
With Sheets
.Item(.Count).Copy _
after:=.Item(.Count)
End With
End Sub


Bill_S wrote:

I need a macro to copy the last sheet in my workbook and put the copy at the
very end of the workbook, in effect it becomes the new last sheet. Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default macro to copy last sheet in workbook

Dave - excellent! I've got a follow-on question. When the new sheet is
created, two of the cells that are populated should be cleared out: the date
cell (E4) and the quote cell (G6.) What should I add to your macro to
accomplish that? thanks.


"Dave Peterson" wrote:

Option Explicit
Sub testem()
With Sheets
.Item(.Count).Copy _
after:=.Item(.Count)
End With
End Sub


Bill_S wrote:

I need a macro to copy the last sheet in my workbook and put the copy at the
very end of the workbook, in effect it becomes the new last sheet. Thanks


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default macro to copy last sheet in workbook

Option Explicit
Sub testme()
With Sheets
.Item(.Count).Copy _
after:=.Item(.Count)
End With
activesheet.range("e4,g6").clearcontents
End Sub



Bill_S wrote:

Dave - excellent! I've got a follow-on question. When the new sheet is
created, two of the cells that are populated should be cleared out: the date
cell (E4) and the quote cell (G6.) What should I add to your macro to
accomplish that? thanks.

"Dave Peterson" wrote:

Option Explicit
Sub testem()
With Sheets
.Item(.Count).Copy _
after:=.Item(.Count)
End With
End Sub


Bill_S wrote:

I need a macro to copy the last sheet in my workbook and put the copy at the
very end of the workbook, in effect it becomes the new last sheet. Thanks


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a Sheet from one Workbook to another Ed Excel Discussion (Misc queries) 0 November 29th 06 06:38 PM
Copy a Sheet from one Workbook to another Randy L Excel Discussion (Misc queries) 0 November 29th 06 06:31 PM
Copy a Sheet from one Workbook to another Elisabeth Excel Discussion (Misc queries) 0 November 29th 06 06:31 PM
Copy a Sheet from one Workbook to another Ed Excel Discussion (Misc queries) 0 November 29th 06 06:11 PM
Copy sheet to new workbook Tim Excel Discussion (Misc queries) 5 April 28th 05 02:00 PM


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"