Hi
In a table: I am trying to fill an offset of multiple checkboxes, only if their state is True.
I came up with this code which most of the time fills ALL the adjacent cells, even the one which state is False. The strange thing is that sometimes the code seams to work. Any idea?
In a table: I am trying to fill an offset of multiple checkboxes, only if their state is True.
I came up with this code which most of the time fills ALL the adjacent cells, even the one which state is False. The strange thing is that sometimes the code seams to work. Any idea?
Code:
Private Sub InnOtraKunde_Click()
Dim strFormulas As String
Dim i As Integer
strFormulas = "=IFERROR([@[Otra_]]*((1-[@[% Avslag Enhetspris kunde]])),""-"")"
For i = 2 To 39
If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = True Then
OLEObjects("CheckBox" & i).TopLeftCell.Offset(0, -1).Value = strFormulas
End If
Next i
End Sub