I have a proposal log I keep. I started a new one for this year, and added a Userform. However, when Itry to run it I get an error.
I had the same userform before, just added more columns to the worksheet. I thought maybe it would work.
I dont' know what a runtime error 70 is exactly, but from what I've read I maybe trying to access too many rows/columns in a range. I have 5 ranges/lists in this userform I'm using. One has about 130 names, the others are quite smaller. Iv'e checked the names.
See the code below.
VBAPic.png
here is the code:
Private Sub btnSubmit_Click()
Dim Sheet1 As Worksheet
Dim agency As Range
Dim state As Range
Dim EFD As Range
Dim carrier As Range
Dim takeover As Range
Set ssheet = ThisWorkbook.Sheets("OpenUserform")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 1) = CDate(Me.tbdate)
ssheet.Cells(nr, 3) = Me.CbAgency
ssheet.Cells(nr, 4) = Me.TbAgentName
ssheet.Cells(nr, 5) = Me.TbGroupName
ssheet.Cells(nr, 6) = Me.TbCity
ssheet.Cells(nr, 7) = Me.CbState
ssheet.Cells(nr, 8) = Me.TbZipCode
ssheet.Cells(nr, 9) = Me.TbGroupSIC
ssheet.Cells(nr, 10) = Me.TbGroupSize
ssheet.Cells(nr, 11) = Me.CbEFD
ssheet.Cells(nr, 12) = Me.CbCarrier
tsheet.Cells(nr, 13) = Me.CbTakeVirgin
If ChkbxSpread.Value = True Then
ssheet.Cells(nr, 14) = "yes"
Else
ssheet.Cells(nr, 14) = ""
End If
If ChkbxDental.Value = True Then
ssheet.Cells(nr, 15) = "yes"
Else
ssheet.Cells(nr, 15) = ""
End If
If ChkbxVision.Value = True Then
ssheet.Cells(nr, 16) = "yes"
Else
ssheet.Cells(nr, 16) = ""
End If
If ChkbxLife.Value = True Then
ssheet.Cells(nr, 17) = "yes"
Else
ssheet.Cells(nr, 17) = ""
End If
If ChkbxSTD.Value = True Then
ssheet.Cells(nr, 18) = "yes"
Else
ssheet.Cells(nr, 18) = ""
End If
If ChkbxLTD.Value = True Then
ssheet.Cells(nr, 19) = "yes"
Else
ssheet.Cells(nr, 19) = ""
End If
UserForm1.CbAgency = ""
UserForm1.TbAgentName = ""
UserForm1.TbGroupName = ""
UserForm1.TbCity = ""
UserForm1.CbState = ""
UserForm1.TbZipCode = ""
UserForm1.TbGroupSIC = ""
UserForm1.TbGroupSize = ""
UserForm1.CbEFD = ""
UserForm1.CbCarrier = ""
UserForm1.CbTakeVirgin = ""
UserForm1.ChkbxSpread = ""
UserForm1.ChkDental = ""
UserForm1.ChkbxVision = ""
UserForm1.ChkbxLife = ""
UserForm1.ChkbxSTD = ""
UserForm1.ChkbxLTD = ""
End Sub
Private Sub CmbUserform_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.tbdate = Date
'Fill the combo box'
For Each cell In [agency]
Me.CbAgency.AddItem cell
Next cell
For Each cell In [state]
Me.CbState.AddItem cell
Next cell
For Each cell In [EFD]
Me.CbEFD.AddItem cell
Next cell
For Each cell In [carrier]
Me.CbCarrier.AddItem cell
Next cell
For Each cell In [takover]
Me.CbTakeVirgin.AddItem cell
Next cell
End Sub
Any Ideas ??
Tony
Bookmarks