View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
[email protected] tylagusim@hotmail.com is offline
external usenet poster
 
Posts: 20
Default names and deleting them

Beats me! I'll have to play with it under XL12 -- probably tomorrow.
Hopefully wiser heads than ours can answer.

/ Tyla /

On Mar 7, 10:26 pm, Steven Cheng
wrote:
Okay found it. I am using XL2007 and there appears to be a hidden name
called "_xlfn.SUMIFS" and yes my file uses SUMIFS function.

what is this name for?

" wrote:
Are you sure the error is at the 'n.delete'? The following code works
he


Sub whatever()


Dim n As Name
Dim wkb As Workbook


Set wkb = Workbooks.Add
ThisWorkbook.ActiveSheet.Cells.Copy


wkb.Activate
ActiveSheet.Paste
For Each n In wkb.Names
n.Delete
Next


Application.CutCopyMode = False


End Sub


/ Tyla /


On Mar 7, 9:26 pm, Steven Cheng
wrote:
I am running a code that is trying to clear out the names that are being
copied over from one workbook to another....


i tried to do this...


Private sub whateveritiscalled()


dim n as name
dim wkb as workbook


set wkb = workbooks.add
thisworkworkbook.activesheet.cells.copy
wkb.activesheet.range("a1").paste 'actually it is pastespecial...not important


for each n in wkb.names
n.delete


next


etc...etc...etc..


however, it keeps getting an error on the n.delete statement...run time
error 1004...must be missing something....can anyone help.