#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default code copy

hi,

i have the following:

Sheets("tester").Copy after:=Sheets("tr")

the "tester" sheet contains code that i would not like to be copied when the
sheet is copied. what can i add to prevent the code from being copied when
the sheet is copied?

thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default code copy

The code is embeded in the sheet so if you copy the sheet then you copy the
code. The easiest way around this is to just create a new sheet and then copy
the cells from tester to the new sheet. Something like this...

Sub CopyTester()
Dim wks As Worksheet

Set wks = Worksheets.Add(After:=Sheets("tr"))
Sheets("tester").Cells.Copy Destination:=wks.Range("A1")

End Sub
--
HTH...

Jim Thomlinson


"geebee" wrote:

hi,

i have the following:

Sheets("tester").Copy after:=Sheets("tr")

the "tester" sheet contains code that i would not like to be copied when the
sheet is copied. what can i add to prevent the code from being copied when
the sheet is copied?

thanks in advance,
geebee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default code copy

hi,

thanks... but the only problem with this code is that it does not
handle/copy any radio buttons that are in the sheet to be copied. how can i
copy these radio buttons?

thanks in advance,
geebee


"Jim Thomlinson" wrote:

The code is embeded in the sheet so if you copy the sheet then you copy the
code. The easiest way around this is to just create a new sheet and then copy
the cells from tester to the new sheet. Something like this...

Sub CopyTester()
Dim wks As Worksheet

Set wks = Worksheets.Add(After:=Sheets("tr"))
Sheets("tester").Cells.Copy Destination:=wks.Range("A1")

End Sub
--
HTH...

Jim Thomlinson


"geebee" wrote:

hi,

i have the following:

Sheets("tester").Copy after:=Sheets("tr")

the "tester" sheet contains code that i would not like to be copied when the
sheet is copied. what can i add to prevent the code from being copied when
the sheet is copied?

thanks in advance,
geebee

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 code Hamster07 New Users to Excel 4 January 30th 07 05:08 PM
Got the Copy/Cut Code But what is the Paste Code Corey Excel Programming 7 July 7th 06 02:23 PM
Help with COPY code JVLin Excel Discussion (Misc queries) 0 March 6th 05 03:33 PM
Copy Code Soniya Excel Programming 5 October 6th 04 03:10 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 07:31 PM.

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"