![]() |
Addin macro to delete names in current workbook
We have a simple macro to delete all named cells in the current workbook. It
works fine in a macro sheet, but we cannot get it to work in an XLA, I believe because we can't seem to grab the active worksheet via VB. Thoughts appreciated. Sub NoNames() ' ' Macro1 Macro ' Macro recorded 7/22/2005 by KURIENT ' Dim n As Long Dim m As Long m = ThisWorkbook.Names.Count For n = 1 To m ThisWorkbook.Names(1).Delete Next n End Sub |
Addin macro to delete names in current workbook
Hi David
Use Activeworkbook instead of Thisworkbook Thisworkbook = the add-in -- Regards Ron de Bruin http://www.rondebruin.nl "David Iacoponi" wrote in message ... We have a simple macro to delete all named cells in the current workbook. It works fine in a macro sheet, but we cannot get it to work in an XLA, I believe because we can't seem to grab the active worksheet via VB. Thoughts appreciated. Sub NoNames() ' ' Macro1 Macro ' Macro recorded 7/22/2005 by KURIENT ' Dim n As Long Dim m As Long m = ThisWorkbook.Names.Count For n = 1 To m ThisWorkbook.Names(1).Delete Next n End Sub |
Addin macro to delete names in current workbook
See also this Add-in
http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... Hi David Use Activeworkbook instead of Thisworkbook Thisworkbook = the add-in -- Regards Ron de Bruin http://www.rondebruin.nl "David Iacoponi" wrote in message ... We have a simple macro to delete all named cells in the current workbook. It works fine in a macro sheet, but we cannot get it to work in an XLA, I believe because we can't seem to grab the active worksheet via VB. Thoughts appreciated. Sub NoNames() ' ' Macro1 Macro ' Macro recorded 7/22/2005 by KURIENT ' Dim n As Long Dim m As Long m = ThisWorkbook.Names.Count For n = 1 To m ThisWorkbook.Names(1).Delete Next n End Sub |
All times are GMT +1. The time now is 04:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com