PC Review


Reply
Thread Tools Rate Thread

How to avoid questions during worksheets copy before ?

 
 
Peter
Guest
Posts: n/a
 
      15th Jul 2011
In my Excel 2010 workbook I want to copy a "master-sheet" e.g. a
formatet sheet with named fields etc but without data.

I use the Worksheets("master").Copy Before:=Sheets(2)

The challenge is, that the user is asked if he want to use the
rangenames from the master-sheet again. Can I avoid that (those, one
for each named range) questions. I have tried with On Error Resume
Next, buy as the question is not an error that statement has no
effect.

Regards

Peter


 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      15th Jul 2011
Use...

Application.Display.Alerts = False

....This must be set to true before exiting your code.
(note that there is more than one way to exit code)
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(free and commercial excel programs)





"Peter" <(E-Mail Removed)>
wrote in message
news:33e876b5-fce1-45a1-a377-(E-Mail Removed)...
> In my Excel 2010 workbook I want to copy a "master-sheet" e.g. a
> formatet sheet with named fields etc but without data.
>
> I use the Worksheets("master").Copy Before:=Sheets(2)
>
> The challenge is, that the user is asked if he want to use the
> rangenames from the master-sheet again. Can I avoid that (those, one
> for each named range) questions. I have tried with On Error Resume
> Next, buy as the question is not an error that statement has no
> effect.
>
> Regards
>
> Peter
>
>



 
Reply With Quote
 
Peter
Guest
Posts: n/a
 
      15th Jul 2011
Hej Jim.

Thank you.

Med venlig hilsen
Peter
 
Reply With Quote
 
GS
Guest
Posts: n/a
 
      15th Jul 2011
Peter expressed precisely :
> In my Excel 2010 workbook I want to copy a "master-sheet" e.g. a
> formatet sheet with named fields etc but without data.
>
> I use the Worksheets("master").Copy Before:=Sheets(2)
>
> The challenge is, that the user is asked if he want to use the
> rangenames from the master-sheet again. Can I avoid that (those, one
> for each named range) questions. I have tried with On Error Resume
> Next, buy as the question is not an error that statement has no
> effect.
>
> Regards
>
> Peter


The question is being asked because the range names used on
Sheets("master") are NOT sheet-level names and so belong to the
workbook, NOT Sheets("master"). Workbook-level names are shared and so
formulas using those names will always refer to the sheet they were
defined on if you answer YES to the question raised when copying the
master sheet.

If you use Sheets("master") as a template, you should give the named
ranges sheet-level scope in the 'Name Manager' dialog. This keeps the
named ranges refs confined to each copy of the sheet and so the
question will never be asked, and formulas using those names will ref
the sheet they're used on.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
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
Running a second copy of XP on the same box to avoid a virus on the first copy mm Windows XP General 13 18th Sep 2010 02:35 AM
Avoid Confirmation Questions Mike H. Microsoft Excel Programming 1 18th Dec 2007 10:01 PM
Sending mail from Excel in VBA, how to avoid security questions? =?Utf-8?B?TWF1cnkgTWFya293aXR6?= Microsoft Outlook Discussion 2 8th Nov 2007 07:26 PM
Copy data from multiple worksheets to worksheets in a number of other spreadsheets SteveH Microsoft Excel Discussion 5 6th Nov 2006 06:59 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values =?Utf-8?B?RGVubmlz?= Microsoft Excel Misc 10 2nd Mar 2006 10:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:39 PM.