Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default create a copy of a sheet and insert it into the same workbook.


This is a piece of code I Got.

For Each sh In ActiveWorkbook.Sheets
' below to check if there is a worksheet with the name locally stored
data and if there is one then delet

If sh.Name = "Locally Stored Data" Then
Application.DisplayAlerts = False
sh.Delete
Application.DisplayAlerts = True
End If
Next sh

' copys a templatte sheet and then rename it and copy data etc.

Sheets("Temp").Visible = True
Sheets("Temp").Select
ActiveSheet.Copy
ActiveSheet.Name = "Locally Stored Data"
Sheets("Temp").Visible = False
Sheets("Data").Visible = True
Range("A9").Select
Selection.CurrentRegion.Select
Selection.Copy
Sheets("Locally Stored Data").Select
Range("A2").Select


It gets to the highlighted part and then copys the Sheet temp into a
new workbook instead of keeping it in the same workbook. any ideas?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=387481

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
Selection copy and insert to other sheet VLOOKUP fORMULA Excel Discussion (Misc queries) 1 March 23rd 10 05:29 PM
create copy of sheet tab (excel 2007) when opening workbook jatman Excel Worksheet Functions 1 February 29th 08 12:26 PM
create a copy of a sheet and insert it into the same workbook. Kaak[_19_] Excel Programming 0 July 15th 05 12:56 PM
How to create a Macro to Copy Information in one sheet to another sheet. poppy Excel Programming 3 July 28th 04 07:26 AM
Insert Row & copy all formulas - shared workbook Eager2Learn[_6_] Excel Programming 1 June 10th 04 05:11 AM


All times are GMT +1. The time now is 06:52 AM.

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

About Us

"It's about Microsoft Excel"