Currently the SQL will pick the value which is present in "Sheet2.Range("C2")" and execute the SQL and store the output into Selection.Offset(1, 1) = sourceRst.Fields("DT_KEY") .
My requirement is i will be having values in Sheet2.C3, C4, C5,and goes on. So, the SQL should pick the value 1 by 1 and execute it and populate the data into the corresponding DB Output field.
Kindly provide me the code which will make the SQL run 1 by 1 till it finds a NULL value in the Sheet2.C field.
I am attaching the Sheet below, kindly look into Sheet2.B column and Sheet2.C column.
Sheet2.C is the date which is passed into the SQL and Sheet2.B is the output from Database.
Bookmarks