Appending data dynamically with in the cell

naresh1231

New Member
Joined
Aug 19, 2019
Messages
1
HI,
I have a cell(A2) with sql query select emp_name from employee where emp_Id=:empNo and emp_designation =:empDesignation

empNo and empDesignation values will be taken from text box


I need a help writing vb script code in extracting sql query from A2 cell followed by appending text box data (empNo and empDesignation ) and add it to variable in VB code.

Ex:
A2 cell has - select emp_name from employee where emp_Id=:empNo and emp_designation =:empDesignation
text boxes are having emp No - Indra AND empDesignation as Manager

Result in vb variable in runtime as something like belowexecSQLQuery = "select emp_name from employee where emp_Id='Indra' and emp_designation='Manager'"
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top