Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Deleting Range Names is Erasing My PrintArea

I have routine that makes a copy of a workbook to save as a snapshot
that has all of the code and range names removed. I couldn't figure out
why my print area was screwed up on my snapshots and then I used the
debug.print to figure out exactly what was causing my print area to be
erased.

here is the code that does it

For Each RName In NewWorkBook.Names
RName.Delete
Next RName

Does anyone have any idea why deleting all of the range names from the
workbook would do this. None of the sheets in my workbook utilize a
named range for it's print area.

Any help would be appreciated.
Thanks
James

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Deleting Range Names is Erasing My PrintArea

Print_Area is a name
Check in the Name box or in Paste Names


--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"JGeniti" wrote in message
oups.com...
I have routine that makes a copy of a workbook to save as a snapshot
that has all of the code and range names removed. I couldn't figure out
why my print area was screwed up on my snapshots and then I used the
debug.print to figure out exactly what was causing my print area to be
erased.

here is the code that does it

For Each RName In NewWorkBook.Names
RName.Delete
Next RName

Does anyone have any idea why deleting all of the range names from the
workbook would do this. None of the sheets in my workbook utilize a
named range for it's print area.

Any help would be appreciated.
Thanks
James



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Deleting Range Names is Erasing My PrintArea

Try this

For Each RName In NewWorkBook.Names
If LCase(ThisName.Name) Like LCase("*!Print_Area") Then
'do nothing
Else
RName.Delete
End If
Next RName

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JGeniti" wrote in message
oups.com...
I have routine that makes a copy of a workbook to save as a snapshot
that has all of the code and range names removed. I couldn't figure out
why my print area was screwed up on my snapshots and then I used the
debug.print to figure out exactly what was causing my print area to be
erased.

here is the code that does it

For Each RName In NewWorkBook.Names
RName.Delete
Next RName

Does anyone have any idea why deleting all of the range names from the
workbook would do this. None of the sheets in my workbook utilize a
named range for it's print area.

Any help would be appreciated.
Thanks
James



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Deleting Range Names is Erasing My PrintArea

Some other specials you should be aware of

*_FilterDatabase
*Print_Area
*Print_Titles
*wvu.*
*wrn.*
*!Criteria


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
Try this

For Each RName In NewWorkBook.Names
If LCase(ThisName.Name) Like LCase("*!Print_Area") Then
'do nothing
Else
RName.Delete
End If
Next RName

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JGeniti" wrote in message
oups.com...
I have routine that makes a copy of a workbook to save as a snapshot
that has all of the code and range names removed. I couldn't figure out
why my print area was screwed up on my snapshots and then I used the
debug.print to figure out exactly what was causing my print area to be
erased.

here is the code that does it

For Each RName In NewWorkBook.Names
RName.Delete
Next RName

Does anyone have any idea why deleting all of the range names from the
workbook would do this. None of the sheets in my workbook utilize a
named range for it's print area.

Any help would be appreciated.
Thanks
James





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Deleting Range Names is Erasing My PrintArea

I believe that when you set the print area and/or rows or columns to appear
on each page that Excel automatically creates a name for that data.
Therefore, your code is deleting that name and Excel then doesn't know what
to print.

I guess you could either add code at the end of your routine to add the
appropriate name back.....Or you could just have your routine not delete the
appropriate name if it is a certain name "Print_Area".

Hope this gets you started in the right direction.

Thanks,
Bill Horton

"JGeniti" wrote:

I have routine that makes a copy of a workbook to save as a snapshot
that has all of the code and range names removed. I couldn't figure out
why my print area was screwed up on my snapshots and then I used the
debug.print to figure out exactly what was causing my print area to be
erased.

here is the code that does it

For Each RName In NewWorkBook.Names
RName.Delete
Next RName

Does anyone have any idea why deleting all of the range names from the
workbook would do this. None of the sheets in my workbook utilize a
named range for it's print area.

Any help would be appreciated.
Thanks
James




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Deleting Range Names is Erasing My PrintArea

Thanks Bob that worked great.

Bob Phillips wrote:
Some other specials you should be aware of

*_FilterDatabase
*Print_Area
*Print_Titles
*wvu.*
*wrn.*
*!Criteria


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
Try this

For Each RName In NewWorkBook.Names
If LCase(ThisName.Name) Like LCase("*!Print_Area") Then
'do nothing
Else
RName.Delete
End If
Next RName

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JGeniti" wrote in message
oups.com...
I have routine that makes a copy of a workbook to save as a snapshot
that has all of the code and range names removed. I couldn't figure out
why my print area was screwed up on my snapshots and then I used the
debug.print to figure out exactly what was causing my print area to be
erased.

here is the code that does it

For Each RName In NewWorkBook.Names
RName.Delete
Next RName

Does anyone have any idea why deleting all of the range names from the
workbook would do this. None of the sheets in my workbook utilize a
named range for it's print area.

Any help would be appreciated.
Thanks
James




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
deleting worksheets from names in a range Jenn Excel Discussion (Misc queries) 2 August 23rd 05 12:00 AM
Deleting all Range Names except Print_Area? Nodak Excel Programming 2 May 17th 05 01:23 PM
Deleting range names CiaraG[_4_] Excel Programming 1 May 10th 04 04:39 PM
Deleting broken range names Ray Kanner[_2_] Excel Programming 1 February 17th 04 02:29 AM
Adding and deleting Range Names Paul Excel Programming 1 October 1st 03 10:56 AM


All times are GMT +1. The time now is 03:44 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"