View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Passing excel cell values as sql variables

sSQL = "SELECT * FROM myTable WHERE id='" & Range("A1").Value & "'"

as I have assumed the id is a string, I have enclosed it in single quotes.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"jai" wrote in message
ps.com...
Hi,
Is there anyway I can pass excel cell values as sql variables???

Regards

Jaideep