Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default renaming a query

I had to change the SQL on an existing query, but the columns came back in
the wrong sequence. So then I deleted the query range (got the warning I was
detelting a query) and built the new query table.

Now too match up with my VBA I want to rename the query table
"ExternalData_1". I receive the message : "A query with this name already
exists on this sheet". Yet when I loop through all the sheets/queryTables. I
do not see the "ExternalData_1" table listed. How do I get Excel to allow me
to rename my new ExternalData_1 query?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default renaming a query

Run this code

Sub MakeNamesvisible()
Dim nme as Name
for each nme in ActiveWorkbook.Names
nme.Visible = True
Next
End sub

Now look at the names collection and you will see there is a defined name
related to each query table. I suspect the "already exists" name is found
there still as well. Perhaps deleting it will allow you to rename your
query.

--
Regards,
Tom Ogilvy


"Candyman" wrote:

I had to change the SQL on an existing query, but the columns came back in
the wrong sequence. So then I deleted the query range (got the warning I was
detelting a query) and built the new query table.

Now too match up with my VBA I want to rename the query table
"ExternalData_1". I receive the message : "A query with this name already
exists on this sheet". Yet when I loop through all the sheets/queryTables. I
do not see the "ExternalData_1" table listed. How do I get Excel to allow me
to rename my new ExternalData_1 query?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming columns in MS Query RhysPieces Excel Discussion (Misc queries) 2 September 10th 07 07:40 PM
Renaming Access Query used by Excel UEUC2 Excel Discussion (Misc queries) 1 December 13th 05 05:19 PM
renaming No Name Excel Programming 1 October 11th 04 05:01 PM
Renaming ianripping[_66_] Excel Programming 3 May 22nd 04 12:02 PM
Renaming within VBA Brent McIntyre Excel Programming 4 August 21st 03 02:10 AM


All times are GMT +1. The time now is 11:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"