我可以使用excel更新表格上的数据吗?

时间:2021-11-07 23:07:36

After the financial department calculate our sales budget, our salesman must to approve or change that budget.

在财务部门计算我们的销售预算后,我们的销售人员必须批准或更改该预算。

We are thinking to create an excel sheet to help them.

我们正在考虑创建一个excel表来帮助他们。

The idea is to read the data from a table and show it on a spreadsheet and let the salesman change some amounts, after that the excel must update a table with the changes.

我们的想法是从表中读取数据并将其显示在电子表格中,然后让销售人员更改一些金额,之后excel必须使用更改更新表。

Is that possible? how could be the approach?

那可能吗?怎么可能是这种方法?

Kind Regards

1 个解决方案

#1


0  

it should be two buttons:

它应该是两个按钮:

1) to retrieve data from DB :

1)从DB检索数据:

Dim qt As QueryTable
sqlstring1 = "SELECT * FROM YourTable ORDER BY ProductID"
With ActiveSheet.QueryTables.Add(Connection:=getConnectionStr, Destination:=Range("A1"), sql:=sqlstring1)

Private Function getConnectionStr2()
getConnectionStr2 = "ODBC;DRIVER={SQL Server};" & _
                   "DATABASE=dbname;" & _
                   "SERVER=100.100.100.100;" & _
                   "UID=username;" & _
                   "PWD=userpassword;"
End Function

2) should loop throw values and create a dynamic Update script.

2)应该循环抛出值并创建动态更新脚本。

#1


0  

it should be two buttons:

它应该是两个按钮:

1) to retrieve data from DB :

1)从DB检索数据:

Dim qt As QueryTable
sqlstring1 = "SELECT * FROM YourTable ORDER BY ProductID"
With ActiveSheet.QueryTables.Add(Connection:=getConnectionStr, Destination:=Range("A1"), sql:=sqlstring1)

Private Function getConnectionStr2()
getConnectionStr2 = "ODBC;DRIVER={SQL Server};" & _
                   "DATABASE=dbname;" & _
                   "SERVER=100.100.100.100;" & _
                   "UID=username;" & _
                   "PWD=userpassword;"
End Function

2) should loop throw values and create a dynamic Update script.

2)应该循环抛出值并创建动态更新脚本。