Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If Statement to select a letter | Excel Worksheet Functions | |||
select case statement | Excel Programming | |||
SELECT statement | Excel Programming | |||
SQL Select statement with Date as | Excel Programming | |||
Adding SQL Select Statement | Excel Programming |