morinia
asked on
Passing a string value from one module to another without quotes in VB in Excel 2010
Experts,
I am trying to pass the following string to a module.
"('8772282202','1356366002 ','0250079 405')"
When defining the string it is requiring me to put quotes around it. However to use the string I do not want the quotes
I have this code to build it.
strInList = "('" & strInList & "')"
What do I do to be able to build the string and then use it, but without the quotes.
I want to my final result to be:
('8772282202','1356366002' ,'02500794 05')
This string will be used in a query
I am trying to pass the following string to a module.
"('8772282202','1356366002
When defining the string it is requiring me to put quotes around it. However to use the string I do not want the quotes
I have this code to build it.
strInList = "('" & strInList & "')"
What do I do to be able to build the string and then use it, but without the quotes.
I want to my final result to be:
('8772282202','1356366002'
This string will be used in a query
are you using a query string to access your query or what?
If you are concatenating this string with another the " wouldn't be included.
ASKER
I read in variables from an Excel column. The variables were stringed together as above. I am concatenating the variables to build the string that would be used in the query.
ie.
Proc Sql;
Create table active_members
as Select a.* from all_Members a
where memberid in .................... (this is where I am concatenating the string in VB)
ie.
Proc Sql;
Create table active_members
as Select a.* from all_Members a
where memberid in .................... (this is where I am concatenating the string in VB)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As I said, when you concatenate the string the double quotes will not be included.
strInList = "('8772282202','1356366002','0250079405')"
strSQL = "Create table active_members " & _
"as Select a.* from all_Members a " & _
"where memberid in " & strInList
MsgBox strSQL