Dominik, This works: Sub delete_names() For Each n In ActiveWorkbook.Names n.Delete Next End Sub Ray ------------------------------------ GR Business Process Solutions Ray Blake Head of Software Design ray@xxxxxxxxx Braedon Newell Road Hemel Hempstead Herts HP3 9PD tel: 01442 396518 fax: 01442 389353 www.grbps.com ------------------------------------ -----Original Message----- From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf Of Dominik.Hudzik@xxxxxxxxxxxxxxxxxxxxx Sent: 08 July 2004 12:25 To: mso@xxxxxxxxxxxxx Subject: [mso] delete names in Excel Hello everybody, I would like to delete all names in Excel. To delete one I am using ins= ert / name / define / delete. To delete all, I've prepared a macro: Sub delete_names() Dim n As Integer For n =3D 1 To Names.Count ActiveWorkbook.Names(n).Delete Next End Sub It is not working: Excel returns Run-time error '9': Subscript out of range. So I have changed n to 1: Sub delete_names2() Dim n As Integer For n =3D 1 To Names.Count ActiveWorkbook.Names(1).Delete Next End Sub This one work. Does some one have an explanation to that? have a great day dominik hudzik ---------------------------------------------------------- Le pr=E9sent message, ainsi que les pi=E8ces ou annexes qui s'y trouven= t =E9ventuellement jointes, s'adressent exclusivement =E0 celles des pers= onnes qu'ils d=E9signent comme destinataires. Constituant de ce fait une correspondance priv=E9e =E0 caract=E8re confidentiel, leur contenu est = prot=E9g=E9 par le secret des correspondances =E9mises, transmises ou re=E7ues par = la voie des t=E9l=E9communications. Si ce message =E9lectronique vous est parve= nu fortuitement, veuillez avoir l'obligeance de le d=E9truire, puis d'en a= viser l'exp=E9diteur dans les meilleurs d=E9lais. The Information in this e-mail belongs to Sanofi-Synthelabo, is intende= d for the use of the individual or entity to which it is addressed, and m= ay contain information that is privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient,= you are hereby notified that any disclosure, copying, distribution, or use = of, or reliance on, the contents of this e-mail is prohibited. If you have= received this e-mail in error, please notify us immediately by replying= back to the sending e-mail address, and delete this e-mail message from= your computer. ----------------------------------------------------------= ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in the subject line. Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles ************************************************************* ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in the subject line. Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles *************************************************************