CsJHUN
Active Member
- Joined
- Jan 13, 2015
- Messages
- 360
- Office Version
- 365
- 2021
- 2019
- Platform
- Windows
- Mobile
Hello guys,
in advance im just learing the passing values between subs (no clue about classes too ), also a lazy a.. for declare items.
I have a userform with (for example) a simple 2x2 + headline (3x3) crosstable. I have option buttons in the data field. I want to color the x(A or B) and y(1 or 2) headline of the clicked radio button.
[TABLE="class: grid, width: 120, align: center"]
<tbody>[TR]
[TD="align: center"]tbl
[/TD]
[TD="align: center"]Headline A
[/TD]
[TD="align: center"]Headline B
[/TD]
[/TR]
[TR]
[TD="align: center"]Headline 1
[/TD]
[TD="align: center"]o A1
[/TD]
[TD="align: center"]o B1
[/TD]
[/TR]
[TR]
[TD="align: center"]Headline 2
[/TD]
[TD="align: center"]o A2
[/TD]
[TD="align: center"]o B2
[/TD]
[/TR]
</tbody>[/TABLE]
So if clicked on A1 then headline A and headline 1 would be red.
Of course the original "table" is bigger than the example (currently 9x7)
The headlines are labels, the "data" is option button (radio button)
I have this:
And this gives me type mismatch error.
Help me understand this, thanks
John
in advance im just learing the passing values between subs (no clue about classes too ), also a lazy a.. for declare items.
I have a userform with (for example) a simple 2x2 + headline (3x3) crosstable. I have option buttons in the data field. I want to color the x(A or B) and y(1 or 2) headline of the clicked radio button.
[TABLE="class: grid, width: 120, align: center"]
<tbody>[TR]
[TD="align: center"]tbl
[/TD]
[TD="align: center"]Headline A
[/TD]
[TD="align: center"]Headline B
[/TD]
[/TR]
[TR]
[TD="align: center"]Headline 1
[/TD]
[TD="align: center"]o A1
[/TD]
[TD="align: center"]o B1
[/TD]
[/TR]
[TR]
[TD="align: center"]Headline 2
[/TD]
[TD="align: center"]o A2
[/TD]
[TD="align: center"]o B2
[/TD]
[/TR]
</tbody>[/TABLE]
So if clicked on A1 then headline A and headline 1 would be red.
Of course the original "table" is bigger than the example (currently 9x7)
The headlines are labels, the "data" is option button (radio button)
I have this:
Code:
Private Sub opbtnclick(ByRef opbtn As OptionButton, ByRef lblx As Label, ByRef lbly As Label)
lblx.BackColor = vbRed
lbly.BackColor = vbRed
End Sub
Private Sub opbtn_1_1_Click()
opbtnclick Me.opbtn_1_1, Me.lbl_1_0, Me.lbl_0_1
End Sub
Private Sub opbtn_1_2_Click()
opbtnclick Me.opbtn_1_2, Me.lbl_0_2, Me.lbl_1_0
End Sub
And this gives me type mismatch error.
Help me understand this, thanks
John