I would like to make a custom function in VBA which takes a dynamic range and a SQL query as input and returns the result from the SQL query.
I have multiple data in my sheet all setup in table format and depending on my inputs that data has to be sorted and filtered.
I know Excel has a build in filter function, but that cannot be used for my purpose.
I have done a lot of search on this subject but haven't been able to find a solution which doesn't require a link to a saved Excel spreadsheet.
I'm thinking of a function like this:
Function GetSql(Input as range, SqlQuery as String)
End Function
Where the input to the function is
ColA ColB ColC
a 1 abc
b 3 abc
c 4 fgh
d 6 fgh
e 4 efr
f 3 er
g 2 jtr
Does anyone have a input how to solve this?
Bookmarks