sending data to excel to a named range

S

Scott

Hello, need help please:

Trying to output information from a query to a named range in excel,
the problem is that the process results in every field in the query
being tranferred to each consecutive column in the range. The problem
for me is that I have a couple of columns within the range that I need
to remain as is. I tried naming the range in excel to be (a1:c5, g1:g5)
as an example however access still puts out the data to the d column
rather then skipping it and putting it into g. I tried creating an
empty field within the query but it blanks out what I have in that
column. I could send out the first filed I want to the first part of
the range, then have another query send out the last field to another
range but this seems like a waste to me and should be able to do in one
step. any help would be greatly appreciated . in case my explanation
is hard to follow, this is what i need

access query fields:

time, temp, depth, pressure

to goto a range in excel that has columns:

time, temp, gradient, gradient2, depth, pressure

obvoiusly i need the fields to go in the right columns, however the data
from access goes into the first 4 columns in the range

tia
 
D

Debra Dalgleish

AFAIK, you can't export from Access to a noncontiguous range in Excel.

You could change the structure in Excel, moving the gradient columns
outside the range. Or, use your idea of sending the data in separate
queries. Or, programmatically export the data, then rearrange it in Excel.
 
H

Homer

Try running your query, then going into the resulting range (which is
automatically named by excel) and inserting columns where your fields go.
Then right click somewhere in the query result and check the data range
properties - make sure 'autofill adjacent columns' is checked.
Place your formulas in your new columns.

When you refresh the data, the query result will return to the current
columns, leaving your columns alone except for adding/deleting them as the
number of records changes.
 

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

Top