PC Review


Reply
 
 
geebee
Guest
Posts: n/a
 
      6th Jun 2008
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 With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      6th Jun 2008
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 With Quote
 
geebee
Guest
Posts: n/a
 
      9th Jun 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy all code to file or print all code cp2599@yahoo.com Microsoft Access Forms 2 28th Apr 2009 10:04 PM
VBA code does not copy and paste to next row for each zip code Miguel Microsoft Excel Programming 5 14th Nov 2008 03:13 PM
Got the Copy/Cut Code But what is the Paste Code Corey Microsoft Excel Programming 7 7th Jul 2006 02:23 PM
vba copy code Paul Microsoft Excel Programming 1 13th Feb 2005 03:28 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Microsoft Excel Programming 1 15th Apr 2004 08:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:54 PM.