excel_lelkes
New Member
- Joined
- May 16, 2017
- Messages
- 30
dear forum members
I´ve several checkboxes (ActiveX)
I want to be able to do the following:
1) if checkbox1 is checked i.e. Range("G11").Value = True
2 ) Range.("J1").Value = Range("G11").offset(0,2).Value
3) if Range("G11").Value = True AND/OR Range("G12").Value = True
then Range.("J1").Value = Range.("J1").Value + Range("G12").offset(0,2).Value
and so on....
This long have I come on my own:
But it´s not working as I wish:
it sums every "post"
twice
Please help me with the solution
Thanks in advance
Regards
Peter
I´ve several checkboxes (ActiveX)
I want to be able to do the following:
1) if checkbox1 is checked i.e. Range("G11").Value = True
2 ) Range.("J1").Value = Range("G11").offset(0,2).Value
3) if Range("G11").Value = True AND/OR Range("G12").Value = True
then Range.("J1").Value = Range.("J1").Value + Range("G12").offset(0,2).Value
and so on....
This long have I come on my own:
VBA Code:
Sub kryss()
Dim rng As Range
Dim cell As Range
With Sheet1
Set rng = .Range("G11:G19")
For Each cell In rng
If cell.Value = True Then
.Range("J1").Value = cell.Offset(0, 2).Value + cell.Offset(0, 2).Value
End If
Next
End With
End Sub
it sums every "post"
twice
Please help me with the solution
Thanks in advance
Regards
Peter