+ Reply to Thread
Results 1 to 2 of 2

Deleting variable web query name

  1. #1
    Registered User
    Join Date
    12-22-2005
    Location
    Sarasota, FL
    Posts
    26

    Deleting variable web query name

    Trying to delete a webquery range that is a variable.


    ActiveWorkbook.Names("st_rejs").Delete

    The first time is "st_rejs" and every time I run a macro the name maybe st_rejs_1 or so 2 or 3.

    How to rewrite this lines of code with that in mind?

  2. #2
    Tom Ogilvy
    Guest

    Re: Deleting variable web query name

    Dim nm as Name
    for each nm in Activeworkbook.Names
    if nm.Name like "st_rejs*" then
    nm.delete
    end if
    Next

    --
    Regards,
    Tom Ogilvy

    "wayliff" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Trying to delete a webquery range that is a variable.
    >
    >
    > ActiveWorkbook.Names("st_rejs").Delete
    >
    > The first time is "st_rejs" and every time I run a macro the name maybe
    > st_rejs_1 or so 2 or 3.
    >
    > How to rewrite this lines of code with that in mind?
    >
    >
    > --
    > wayliff
    > ------------------------------------------------------------------------
    > wayliff's Profile:

    http://www.excelforum.com/member.php...o&userid=29860
    > View this thread: http://www.excelforum.com/showthread...hreadid=502192
    >




+ 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