Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List box ' VBA


Please help me a new user on how to create a list box on a worksheet,
pass the selection to a query in VB.

For example:

In this query select name from x where y 1000

I need to be able to select the "name" from the list box and pass it t
the query. The pupose is to be able to dynamically select items in th
database at random

Also, how do I do the second part? If I type y 1000 can that stin
be passed to the query? How is that done and what is the syntax ..
specially on the VB side?

Any help will be much appreciated.

Thanks in advance,

~Anush

--
Anush
-----------------------------------------------------------------------
Anusha's Profile: http://www.excelforum.com/member.php...fo&userid=2711
View this thread: http://www.excelforum.com/showthread.php?threadid=46631

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default List box ' VBA

Why not use the Autofilter or the Advanced filter under the data menu.
(assuming you are querying data on a worksheet)

--
Regards,
Tom Ogilvy

"Anusha" wrote in
message ...

Please help me a new user on how to create a list box on a worksheet,
pass the selection to a query in VB.

For example:

In this query select name from x where y 1000

I need to be able to select the "name" from the list box and pass it to
the query. The pupose is to be able to dynamically select items in the
database at random

Also, how do I do the second part? If I type y 1000 can that sting
be passed to the query? How is that done and what is the syntax ...
specially on the VB side?

Any help will be much appreciated.

Thanks in advance,

~Anusha


--
Anusha
------------------------------------------------------------------------
Anusha's Profile:

http://www.excelforum.com/member.php...o&userid=27119
View this thread: http://www.excelforum.com/showthread...hreadid=466314



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List box ' VBA


I orchestrated my first VB yesterday... So I am a novice.

I am not sure what you mean... I have used filter and wuto filter
before, but how do I incoroprate it into my VB code so it is
automated.

Currently I manually pull data via ODBC

For eg. select x from Y where z 1000 and dt = 20041231

What I want to be able to do is to input x and z 1000 and pass it to
the query t run.

I was able to this with the dt = part yesterday where I pass in the
date. And that took a whole day.

I am not sure how to do the rest.. like being able to select a item frm
a list and have it represent x.

Thanks in advance.


--
Anusha
------------------------------------------------------------------------
Anusha's Profile: http://www.excelforum.com/member.php...o&userid=27119
View this thread: http://www.excelforum.com/showthread...hreadid=466314

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
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 2 July 20th 09 11:18 PM
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 1 July 20th 09 08:41 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM


All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"