Skip to content
Advertisement

Adding parameter to SQL query

I want to get some data from Excel table using SQL-query inside macros.

My code is:

If I try using sql = "SELECT * FROM [Page 1$] WHERE Job = 2", I have no errors.

How could I paste Value2 and Value1 values inside my SQL-query?

Advertisement

Answer

Try like this

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement