Help with grabbing data from query into variable

pjmatelli

Board Regular
Joined
Oct 13, 2005
Messages
206
Hi all,
I don't even know how to search for this one. What I need to do is run a query and then take the value(s) in one field for each record and put them into a variable to be used later. Hope that makes sense...here's an example

Field 1
2456, 2938
5432
1234

Result
"2456, 2938, 5432, 1234"

How do I get to that result? I have tried many different ways of looping and I can't seem to get the code to grab the data correctly. Any help, as always, is greatly appreciated.

TIA
 
Paula

What code are you trying?

This should be a pretty straighforward exercise.

The hard part would be to get the code up and running correctly on some sample data.

Once that's done then all you should need to do is run it on the 'real' thing.
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,224,574
Messages
6,179,634
Members
452,934
Latest member
Jdsonne31

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