Hi i am new to vba and i have this business requirement where a function (not macro) need to be created which makes connection with oracle database and query particular table where the query has where condition. It should be like if i enter the function in excel cell and the where condition(parameter) it should return the value.

for eg: =getdata(ID)-----> corresponding query is "select first_name from employees where id = &id(user input)"

Is it possible? Couldn't find much on web.

thanks