Deleting variable web query name

  • Thread starter Thread starter wayliff
  • Start date Start date
W

wayliff

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?
 
Dim nm as Name
for each nm in Activeworkbook.Names
if nm.Name like "st_rejs*" then
nm.delete
end if
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top