For work, I have to generate some QR code with info in it. Therefore, I checked on internet and found this "already made" QR code generator : https://github.com/JonasHeidelberg/barcode-vba-macro-only It's very nice, and works quite well. I'm trying to integrate it into my VBA sheet to do data treatment before using the code to create the final QR code. (Nothing complex) here is how it looks like : My concern is that "whatever cell I modify in the whole workbook, it lunches the QR code generator." I wanted to give a condition at the beginning of the code like If cell A4 is modified, lunch the code, but I don't even achieve to understand what makes the code start and how the data are gathered... My best guess is that this is the beginning of the code : Public Function EncodeBarcode(ShIx As Integer, xAddr As String, _ code As String, pbctype%, Optional pgraficky%, _ Optional pparams%, Optional pzones%) As String Dim s$, bctype%, graficky%, params%, zones% Dim oo As Object Call Init If IsMissing(pzones) Then zones = 2 Else zones = pzones If IsMissing(pparams) Then params = 0 Else params = pparams If IsMissing(pgraficky) Then graficky = 1 Else graficky = pgraficky If IsMissing(pbctype) Then bctype = 0 Else bctype = pbctypeBut how is it started? O.o I thought a line like Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, cancel As Boolean) followed by a control of the value of "target" was mandatory... Here, it looks like magic to me :( How does xAddr gets the address of the cell I clicked? Magic again... I would like the execution of the code to happen only when I click the button I created. (it generate some infinite loops and excel shuts down :/ ) Or, if not possible, I would like it to be executed only when the data in the cell A4 are modified. Thank's for your help :) (责任编辑:) |