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

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Overwriting a table with another query

For Each itm In ActiveSheet.Names

itm.Delete

Next itm

"Jacques Q" wrote:

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Overwriting a table with another query

Ok so here is my actual code.

Sheets("RickSales").Select

For Each itm In ActiveSheet.Names
itm.delete
Next itm

It runs without error, tho it still doesnt seem to delete anything, i.e find
any items in the ActiveSheet, any other ideas? Thanks again!

- Jacques


"joel" wrote:

For Each itm In ActiveSheet.Names

itm.Delete

Next itm

"Jacques Q" wrote:

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Overwriting a table with another query

hi
it's not finding items ON the sheets. it's finding named ranges and deleting
them.
excel considers microsoft query as a named range.
do you still have named ranges in the name box? or in the define name dialog?
can you run your original code without error now?

i ran the code on a test file. worked.

Regards
FSt1


"Jacques Q" wrote:

Ok so here is my actual code.

Sheets("RickSales").Select

For Each itm In ActiveSheet.Names
itm.delete
Next itm

It runs without error, tho it still doesnt seem to delete anything, i.e find
any items in the ActiveSheet, any other ideas? Thanks again!

- Jacques


"joel" wrote:

For Each itm In ActiveSheet.Names

itm.Delete

Next itm

"Jacques Q" wrote:

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Overwriting a table with another query

First, thanks for the quick replies!
On another note, is it relevant if im using excel 2007?
The named ranges are still there in the name box, and all the tables are
still on the sheet. Still runs without error. Again I appreciate any other
ideas, thanks!

- jacques

"FSt1" wrote:

hi
it's not finding items ON the sheets. it's finding named ranges and deleting
them.
excel considers microsoft query as a named range.
do you still have named ranges in the name box? or in the define name dialog?
can you run your original code without error now?

i ran the code on a test file. worked.

Regards
FSt1


"Jacques Q" wrote:

Ok so here is my actual code.

Sheets("RickSales").Select

For Each itm In ActiveSheet.Names
itm.delete
Next itm

It runs without error, tho it still doesnt seem to delete anything, i.e find
any items in the ActiveSheet, any other ideas? Thanks again!

- Jacques


"joel" wrote:

For Each itm In ActiveSheet.Names

itm.Delete

Next itm

"Jacques Q" wrote:

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Overwriting a table with another query

Make sure the correct page is active. You can replace activesheet with
Sheets("RickSales"). Make sure you don't have any other workbooks opened.
Check if you have any megeed cells. highlight the entire worksheet and go to
format - Cells - alignment and make sure merged cells isn't checked.

For Each itm In Sheets("RickSales").Names
itm.delete
Next itm


"Jacques Q" wrote:

First, thanks for the quick replies!
On another note, is it relevant if im using excel 2007?
The named ranges are still there in the name box, and all the tables are
still on the sheet. Still runs without error. Again I appreciate any other
ideas, thanks!

- jacques

"FSt1" wrote:

hi
it's not finding items ON the sheets. it's finding named ranges and deleting
them.
excel considers microsoft query as a named range.
do you still have named ranges in the name box? or in the define name dialog?
can you run your original code without error now?

i ran the code on a test file. worked.

Regards
FSt1


"Jacques Q" wrote:

Ok so here is my actual code.

Sheets("RickSales").Select

For Each itm In ActiveSheet.Names
itm.delete
Next itm

It runs without error, tho it still doesnt seem to delete anything, i.e find
any items in the ActiveSheet, any other ideas? Thanks again!

- Jacques


"joel" wrote:

For Each itm In ActiveSheet.Names

itm.Delete

Next itm

"Jacques Q" wrote:

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Overwriting a table with another query

Still no luck, no merged cells. Macro still runs, but still does nothing.

"joel" wrote:

Make sure the correct page is active. You can replace activesheet with
Sheets("RickSales"). Make sure you don't have any other workbooks opened.
Check if you have any megeed cells. highlight the entire worksheet and go to
format - Cells - alignment and make sure merged cells isn't checked.

For Each itm In Sheets("RickSales").Names
itm.delete
Next itm


"Jacques Q" wrote:

First, thanks for the quick replies!
On another note, is it relevant if im using excel 2007?
The named ranges are still there in the name box, and all the tables are
still on the sheet. Still runs without error. Again I appreciate any other
ideas, thanks!

- jacques

"FSt1" wrote:

hi
it's not finding items ON the sheets. it's finding named ranges and deleting
them.
excel considers microsoft query as a named range.
do you still have named ranges in the name box? or in the define name dialog?
can you run your original code without error now?

i ran the code on a test file. worked.

Regards
FSt1


"Jacques Q" wrote:

Ok so here is my actual code.

Sheets("RickSales").Select

For Each itm In ActiveSheet.Names
itm.delete
Next itm

It runs without error, tho it still doesnt seem to delete anything, i.e find
any items in the ActiveSheet, any other ideas? Thanks again!

- Jacques


"joel" wrote:

For Each itm In ActiveSheet.Names

itm.Delete

Next itm

"Jacques Q" wrote:

Hi there,
So I am receiving this error:
'1004' A table cannot overlap a range that contains another table...

I am creating a vb macro to obtain data and write this data to different
specific sheets ( which may already contain data )

I am importing data from microsoft query. The table is then created from
this data, and is dynamic in size, tho when data exists, it doesnt seem to
work.

Im assuming the best way to get around this error, is to delete the table
that exists, if there is one. Is there some specific VB code that will allow
me to do this? Any help is greatly appreciated! Thanks!

- jacques

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
Web Query and table? Donal McWeeney Excel Programming 8 May 23rd 07 10:32 AM
Use a button to create a table in excel without overwriting cells Carlo Excel Programming 3 July 8th 05 05:48 PM
VB way to remove the query from a Query Table? Toby Erkson[_3_] Excel Programming 4 October 29th 04 03:16 PM
Overwriting/Overlapping web query problem dule[_5_] Excel Programming 0 February 27th 04 04:14 PM
Linking a table in Access to a table in Excel using MS Query Diana[_5_] Excel Programming 1 January 16th 04 09:43 PM


All times are GMT +1. The time now is 10:48 AM.

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"