Hello there,
I have been adding checkbox dynamically.
Everything looks good, but when I check the Boxes; the Check mark looks different sizes (See Attachments)
Bellow is the subroutinue used for when UserForm initialize.
Thank you in advance,
Ernie
Private Sub UserForm_Initialize()
Dim lastcol As Long
Dim lastrow As Long
Dim r1 As Long
Dim top As Integer
Dim RangeLastCell As Range
Dim SeasonName As String
Dim SeasonCode As String
Dim YearCode As String
Dim iIndex As Long
Dim myCheckBox As msforms.CheckBox
Run "GetSeasons"
top = 15
With SubmitButton
.Enabled = False
End With
Set RangeLastCell = ActiveWorkbook.ActiveSheet.Range("A1").SpecialCells(xlCellTypeLastCell)
lastrow = RangeLastCell.Row
lastcol = RangeLastCell.Column
For iIndex = 1 To (lastrow - 1)
r1 = iIndex + 1
Set myCheckBox = UserForm1.Controls.Add("Forms.CheckBox.1")
top = top + 35
With myCheckBox
.Left = 20
.top = top
.Height = 20
.Width = 100
.Font.Size = 12
.Visible = True
SeasonCode = ActiveSheet.Range("B" & CStr(r1)).Value
YearCode = Mid(ActiveSheet.Range("B" & CStr(r1)).Value, 2, 2)
If Left(SeasonCode, 1) = "F" Then
SeasonName = "Fall"
End If
If Left(SeasonCode, 1) = "S" Then
SeasonName = "Spring"
End If
.Name = SeasonCode
.Caption = SeasonName & " " & YearCode
ReDim Preserve eCheck(1 To iIndex)
Set eCheck(iIndex).EditCheck = myCheckBox
End With
Set myCheckBox = Nothing
Next
End Sub
endofseasonsPic.jpg
Bookmarks