steff.sullivan
New Member
- Joined
- Aug 18, 2008
- Messages
- 20
I'm trying to build a workbook that builds a query table based on a user's entry of a parameter and have this change when they enter a new parameter.
I've built the macro so that it's structured like so
1) clear any existing data
2) get data from report
3) copy and transpose it to another sheet
4) clear original site of the report
and attached this to a button called "Go".
That works fine, but Excel is remembering the fact that I've used the query table name before and incrementing it's name with a "_n" and is consequently causing me difficulties when I try referring to the named query table.
The code I'm using to delete existing named ranges is:
For Each nName In Names
nName.Delete
Next nName
Does anyone know how to do this and ensure that when excel creates the new named range it resets the count of the name to 0?
Thanks in advance
I've built the macro so that it's structured like so
1) clear any existing data
2) get data from report
3) copy and transpose it to another sheet
4) clear original site of the report
and attached this to a button called "Go".
That works fine, but Excel is remembering the fact that I've used the query table name before and incrementing it's name with a "_n" and is consequently causing me difficulties when I try referring to the named query table.
The code I'm using to delete existing named ranges is:
For Each nName In Names
nName.Delete
Next nName
Does anyone know how to do this and ensure that when excel creates the new named range it resets the count of the name to 0?
Thanks in advance