I am attempting to create a user form that will propagate the first available row of the excel sheet with information. I am struggling to get the range correct, and the form is currently showing 'Subscript out of range' ; 'Runtime error 9'. There also seems to be a problem with the 'if' statement, but following the standard advice online doesn't seem to have helped solve the problem.
If anyone has any idea where I'm going wrong (I'm very new to this) that would be great.
Private Sub UserForm_Initialize()
BusinessAreaBox.List = Array("option one", "option two")
End Sub
Private Sub CommandButton1_Click()
Dim RowCount As Long
RowCount = Sheets("Sheet1").Range.Sheets("Sheet1").Cells(2, "A")
With ThisWorkbook.Sheets("Sheet1").Range("A2")
.Offset(RowCount, 0).Value = BusinessArea1.Value
.Offset(RowCount, 1).Value = BusinessContact1.Value
.Offset(RowCount, 2).Value = LPSContact1.Value
.Offset(RowCount, 4).Value = ProjectedFTE1.Value
.Offset(RowCount, 5).Value = DateOfMostRecentMeeting1.Value
.Offset(RowCount, 6).Value = FTEComment1.Value
.Offset(RowCount, 7).Value = ProposedMove1.Value
.Offset(RowCount, 8).Value = DeskUtilisation1.Value
.Offset(RowCount, 9).Value = OtherComment1.Value
.Offset(RowCount, 10).Value = Actions1.Value
If RegularMeeting1.Value = True Then
.Offset(RowCount, 3).Value = "Yes"
Else
.Offset(RowCount, 3).Value = "No"
End If
RegularMeeting1.Value = True Or False
End With
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub