Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SQL Select Statement in Excel


Hi is there anyway to create macro/ VBSCript to execute SQL Selec
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B
LastName
And then in another spreadsheet2 I want to look up value t
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustin

--
agustina_
-----------------------------------------------------------------------
agustina_s's Profile: http://www.excelforum.com/member.php...fo&userid=3009
View this thread: http://www.excelforum.com/showthread.php?threadid=49781

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default SQL Select Statement in Excel

SQL - depends if they are in the same workbook. if the sheets are in
different workbooks, you can use MS Query to get external data from a closed
Excel workbook (either from the 1st sheet or a named range)

if its in the same workbook, try using an advanced filter they would look
like

FIRST_NAME LAST_NAME
Smith
Anderson

using 2 lines is basically an 'or' statement

you could also use a lookup function if you want to do it within a formula.
a workaround alternative to the SQL "in" statement is FIND where you say

=if(FIND("Smith","Smith,Jones")0,FIRST_NAME,"")

This potentially lets you work within a formula

hope this helps - voodooJoe

"agustina_s" wrote
in message ...

Hi is there anyway to create macro/ VBSCript to execute SQL Select
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B =
LastName
And then in another spreadsheet2 I want to look up value to
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustina


--
agustina_s
------------------------------------------------------------------------
agustina_s's Profile:
http://www.excelforum.com/member.php...o&userid=30094
View this thread: http://www.excelforum.com/showthread...hreadid=497813



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SQL Select Statement in Excel

Hi,

Try to use VLookup formaulae in excel, hope this helps to lookup the
value.

Warm regards,
Di$c0ver


agustina_s wrote:
Hi is there anyway to create macro/ VBSCript to execute SQL Select
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B =
LastName
And then in another spreadsheet2 I want to look up value to
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustina


--
agustina_s
------------------------------------------------------------------------
agustina_s's Profile: http://www.excelforum.com/member.php...o&userid=30094
View this thread: http://www.excelforum.com/showthread...hreadid=497813


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default SQL Select Statement in Excel

Look at my answer to the post of 2 December 2005:
Count duplicates in an array?

RBS


"agustina_s" wrote
in message ...

Hi is there anyway to create macro/ VBSCript to execute SQL Select
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B =
LastName
And then in another spreadsheet2 I want to look up value to
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustina


--
agustina_s
------------------------------------------------------------------------
agustina_s's Profile:
http://www.excelforum.com/member.php...o&userid=30094
View this thread: http://www.excelforum.com/showthread...hreadid=497813


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
If Statement to select a letter Karl Excel Worksheet Functions 3 February 8th 08 04:01 PM
select case statement jrd269[_4_] Excel Programming 4 June 3rd 05 04:22 PM
SELECT statement Tom Ogilvy Excel Programming 2 July 23rd 04 06:24 PM
SQL Select statement with Date as Pepe[_2_] Excel Programming 3 February 4th 04 06:50 PM
Adding SQL Select Statement Pepe[_2_] Excel Programming 1 January 29th 04 02:19 AM


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