Copying cells which have MS Query results

markd89

New Member
Joined
Jan 7, 2006
Messages
12
Hi,

I'm using Excel 2010.

I have a cell which displays a number returned from a SQL Server stored procedure. The stored procedure takes two inputs -- a date and an employee name. I have Excel properly pulling these from two cells in the sheet. The employee name "BILL" is in J1.

See: http://realityisreality.com/xl/ex1.jpg

So far, so good. I can change the date or change the name in J1 and the number updates dynamically.

Now, I want to copy/paste my source cell to another cell so that I can use it to get the same date but a different employee name. The original cell uses data from J as the name parameter. I copy and paste it to K and I expect the parameters to automatically update to use K, but they don't - they keep using J.

Question#1: How can I fix that so that Excel will automatically change the parameters when I copy/paste?

Question#2: Is t here a way to suppress "Column1"

This is a simple example. My project is to convert an Excel 2003 sheet which makes heavy use of SQL.REQUEST to work with Office 2010, so I know I need to resolve the two above to pull it off.

Thanks!

Mark
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Question #2 I figured out. Click into the cell with the query result, on the Ribbon, click Table Tools Design and uncheck Header Row.

Question #1, is the bigger issue. My "real" spreadsheet has hundreds of cells, each of which is a total from a different stored procedure. To boil it down simply, I really need to be able to:

a. Copy cell J1, J2, J3 from my example (see the .JPG)
b. Paste into K1, K2, K3
c. Have the Stored procedure use K1 for it's parameter rather than J1.

Any help, much appreciated!

Mark
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top