Sub kk ()
Dim B (0 To 15) As Byte
For I=0 To 15
B (I)="0"
Next
If CheckBox1. Checked=True (0)="1" Then B
If CheckBox2. Checked=True Then B (1)="1" 'new added
If CheckBox3. Checked=True Then B (2)="1"
If CheckBox4. Checked=True Then B (3)="1"
If CheckBox5. Checked=True Then B (4)="1"
If CheckBox6. Checked=True Then B (5)="1"
If CheckBox7. Checked=True Then B (6)="1"
If CheckBox8. Checked=True Then B (7)="1"
If CheckBox9. Checked=True Then B="1" (8)
If CheckBox10. Checked=True Then B (9)="1"
If CheckBox11. Checked=True Then B (10)="1"
If CheckBox12. Checked=True Then B (11)="1"
If CheckBox13. Checked=True Then B (12)="1"
If CheckBox14. Checked=True Then B (13)="1"
If CheckBox15. Checked=True Then B (14)="1"
If CheckBox16. Checked=True Then B (15)="1"
TextBox1. Text=""
A=0
C=0
D=0
For I=0 To 7
C=C + B (I)
Next
For I=8 To 15
D=D + B (I)
Next
For I=2 To 11.
A=A + B (I)
Consult everybody, I want to have A this variable into hexadecimal, how to do
CodePudding user response:
Hex (A)CodePudding user response:
You end up there, "two to 11" is why? Only 10 bit in the middle of it?dim n as long
N=1
For I=2 to 11.
A=A + n * B (I)
N=n + n
Next
With dozen of code, but there should be no problem,
CodePudding user response:
Msgbox hex (A)CodePudding user response:
I only want 2 to 11CodePudding user response:
Now that require A hexadecimal, I guess (I) should B A value, A calculation method is wrong (the first is the number of statistics in 1),'calculated on a value'
For I=2 To 11.
A=A + B (I) * (2 ^ I)
Next
'displays hexadecimal'
MsgBox "& amp; H "& amp; Hex (A)
CodePudding user response:
I need to ridicule control array again.If there are 1000 checkbox, the building code is very sexy.
CodePudding user response: