Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dmorri254
 
Posts: n/a
Default Data Range Will Not Expand

Hi,

Whenever I update my query to bring in new data, the defined range will not
expand to include the new data. How do I correct this si that when the new
data is returned, the defined range expands to include the new data.

Thanx
  #2   Report Post  
Frank T
 
Posts: n/a
Default

There is a defined name that specifies the range. You must either manually
update the range or create a dynamic name using formulas in the Defined
Names. The Name you currently have is probably "Database" and the reference
will look like
=Sheet1!$A$1:$E$500

No matter how you update the query this would only look down to row 500. To
make it dynamic I use the following trick:
Select the data sheet and create a name to find the last used row
In the Defined Name box type QTY
In the Reerence box type:
=MAX(ROW(IF(ISBLANK($A$2:$A$65536),0,$A$2:$A$65536 )),1)
Add the name
Now click on the name "Database"
Change the reference to look like this:
=OFFSET($A$1,0,0,QTY,5)

QTY counts the used rows and 5 says I have 5 columns. Modify as needed to
fit your situation.

"Dmorri254" wrote:

Hi,

Whenever I update my query to bring in new data, the defined range will not
expand to include the new data. How do I correct this si that when the new
data is returned, the defined range expands to include the new data.

Thanx

  #3   Report Post  
Dmorri254
 
Posts: n/a
Default

Thanx Frank...will try this....do you know of a way to use a excel to update
a record in a database? I have a posting on this that no one seems to know
the answer.

Thanx again

"Frank T" wrote:

There is a defined name that specifies the range. You must either manually
update the range or create a dynamic name using formulas in the Defined
Names. The Name you currently have is probably "Database" and the reference
will look like
=Sheet1!$A$1:$E$500

No matter how you update the query this would only look down to row 500. To
make it dynamic I use the following trick:
Select the data sheet and create a name to find the last used row
In the Defined Name box type QTY
In the Reerence box type:
=MAX(ROW(IF(ISBLANK($A$2:$A$65536),0,$A$2:$A$65536 )),1)
Add the name
Now click on the name "Database"
Change the reference to look like this:
=OFFSET($A$1,0,0,QTY,5)

QTY counts the used rows and 5 says I have 5 columns. Modify as needed to
fit your situation.

"Dmorri254" wrote:

Hi,

Whenever I update my query to bring in new data, the defined range will not
expand to include the new data. How do I correct this si that when the new
data is returned, the defined range expands to include the new data.

Thanx

  #4   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Dmorri254" wrote in message
...
Hi,

Whenever I update my query to bring in new data, the defined range will

not
expand to include the new data. How do I correct this si that when the new
data is returned, the defined range expands to include the new data.

Thanx


An alterantive approach is to use the combination of VBA and ADO to get data
from your datbase into Excel. With this approach, you don't have to worry
about range problems. Here's a link
http://www.exceltip.com/st/Import_data_from_Access_to_Excel_(ADO)_using_VBA_i n_Microsoft_Excel/427.html

/Fredrik


  #5   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Dmorri254" wrote in message
...
Thanx Frank...will try this....do you know of a way to use a excel to

update
a record in a database? I have a posting on this that no one seems to know
the answer.

Thanx again


I have answered that question.

/fredrik


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
data range Steve M Excel Discussion (Misc queries) 0 April 4th 05 11:17 PM
Eliminate empty cells in data range Stephen Excel Discussion (Misc queries) 1 April 2nd 05 04:00 AM
Formula Changes when data entered in referenced range mac849 Excel Discussion (Misc queries) 5 March 21st 05 01:57 AM
How do I search a data range for a particular value then collate . Hulkascooby Excel Discussion (Misc queries) 0 January 19th 05 03:21 PM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 03:30 AM


All times are GMT +1. The time now is 02:01 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"