Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Cell value for Query

Hi All......
I have a line of code used to run a MSQuery. It works fine as is, but I
would like to extract the hard coded 165167 and instead obtain it from a cell
value or preferably from an InputBox............
Here's the code snippet......

& Chr(10) & "WHERE (WO.WONUM='165167')" _

Any help would be much appreciated........

Vaya con Dios,
Chuck, CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Cell value for Query

& Chr(10) & "WHERE (WO.WONUM='" & Range("A1").Value & "')" _

would be one way. Range("A1") can be replace with inputbox.

There is also a parameter query option with a query table. This is part of
the definition of query, so it can pop up its own box or get the value from a
cell.

See these links for that possibility

http://nickhodge.co.uk/gui/datamenu/...taexamples.htm

http://www.dicks-clicks.com/excel/Ex...htm#Parameters

--
Regards,
Tom Ogilvy



"CLR" wrote:

Hi All......
I have a line of code used to run a MSQuery. It works fine as is, but I
would like to extract the hard coded 165167 and instead obtain it from a cell
value or preferably from an InputBox............
Here's the code snippet......

& Chr(10) & "WHERE (WO.WONUM='165167')" _

Any help would be much appreciated........

Vaya con Dios,
Chuck, CABGx3


  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Cell value for Query

Thanking you very much, kind Sir, worked like a charm...............it's good
to see you!

Vaya con Dios,
Chuck, CABGx3



"Tom Ogilvy" wrote:

& Chr(10) & "WHERE (WO.WONUM='" & Range("A1").Value & "')" _

would be one way. Range("A1") can be replace with inputbox.

There is also a parameter query option with a query table. This is part of
the definition of query, so it can pop up its own box or get the value from a
cell.

See these links for that possibility

http://nickhodge.co.uk/gui/datamenu/...taexamples.htm

http://www.dicks-clicks.com/excel/Ex...htm#Parameters

--
Regards,
Tom Ogilvy



"CLR" wrote:

Hi All......
I have a line of code used to run a MSQuery. It works fine as is, but I
would like to extract the hard coded 165167 and instead obtain it from a cell
value or preferably from an InputBox............
Here's the code snippet......

& Chr(10) & "WHERE (WO.WONUM='165167')" _

Any help would be much appreciated........

Vaya con Dios,
Chuck, CABGx3


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
How to use the value in a cell to run a query Bob1866 Excel Discussion (Misc queries) 1 August 29th 09 11:20 PM
Go to cell - Query Bill Excel Worksheet Functions 5 June 30th 08 12:03 AM
Web Query for a Single Cell Scott Excel Discussion (Misc queries) 0 April 6th 08 01:23 PM
Query on Cell VIVEKMANE Excel Discussion (Misc queries) 1 December 7th 07 10:06 AM
web query based on cell value daveB Excel Programming 3 April 20th 04 11:03 PM


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