ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I "set" a checkbox name like i Set a worksheet? (https://www.excelbanter.com/excel-programming/329977-re-how-can-i-set-checkbox-name-like-i-set-worksheet.html)

mangesh_yadav[_212_]

How can I "set" a checkbox name like i Set a worksheet?
 

Hi JustChris,

I tried your code and it works real nice.

This is what I tried:

Private Sub CommandButton1_Click()

Dim checknum As Integer
Dim blahblah As Integer

If TextBox1 = 1 Then
checknum = 1
End If

If TextBox1 = 2 Then
checknum = 2
End If

Call checkbox_num(checknum)
End Sub

Sub checkbox_num(checknum)

Dim chckbox As Object

Set chckbox = UserForm3.Controls("checkbox" & checknum)
chckbox.Value = True

End Sub


Are you encountering any problems with this method

- Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=373048



All times are GMT +1. The time now is 05:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com