Excel vlookup incorporating SQL table

前端 未结 2 1788
旧时难觅i
旧时难觅i 2020-12-15 01:53

I have an Excel spreadsheet which I use to calculate the cost of a product we sell, (happens to be car insurance). This product is calculated based on various pieces of inf

2条回答
  •  离开以前
    2020-12-15 02:43

    You can. In the VBA of the sheet, create a function like so:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    

    and in it's body

    • Check the Target is the cell you want to base your lookup on (G1)
    • If it is, get the data from the DB and put it where it needs to go

    Cheers -

提交回复
热议问题