+ Reply to Thread
Results 1 to 3 of 3

Addin macro to delete names in current workbook

  1. #1
    David Iacoponi
    Guest

    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

  2. #2
    Ron de Bruin
    Guest

    Re: 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" <DavidIacoponi@discussions.microsoft.com> wrote in message
    news:5895789D-F80B-40E8-BD70-20317BABE4CC@microsoft.com...
    > 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




  3. #3
    Ron de Bruin
    Guest

    Re: 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" <rondebruin@kabelfoon.nl> wrote in message news:uS6kDxhuFHA.2948@TK2MSFTNGP15.phx.gbl...
    > Hi David
    >
    > Use Activeworkbook instead of Thisworkbook
    >
    > Thisworkbook = the add-in
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "David Iacoponi" <DavidIacoponi@discussions.microsoft.com> wrote in message
    > news:5895789D-F80B-40E8-BD70-20317BABE4CC@microsoft.com...
    >> 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

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1