View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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" wrote in
message ...

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