Hi All
I am attempting to create a sub to perform one task if a cell contains a "Y" another if "N" and another if "". If it contains anything else it should call another sub.
I have the following code, but keep coming up with the same "else without if" error. I am a bit of an amateur, so any advice with my code would be great as well, but it would be really useful to be able to fix this error. Thanks
Will
I am attempting to create a sub to perform one task if a cell contains a "Y" another if "N" and another if "". If it contains anything else it should call another sub.
I have the following code, but keep coming up with the same "else without if" error. I am a bit of an amateur, so any advice with my code would be great as well, but it would be really useful to be able to fix this error. Thanks
Will
VBA Code:
Sub HWDataEntry()
'
' Homework Data Entry Macro
' This macro loops taking marks, adds them to the
' Homework sheet. Those who haven't submitted are
' added to the detentions list and any data that
' does not meet the value criteria is queried via
' message box
'
Dim usrinput As String
Dim iresponse As Integer
Dim answerinp As String
Sheets("Homework").Select
Range("B4").Select
Sheets("Submition Forms").Select
Range("C4").Select
Do
If ActiveCell.Value = "Y" Then
ActiveCell.Copy
Sheets("Homework").Select
ActiveCell.Select
Selection.PasteSpecial
ActiveCell.Offset(1, 0).Select
Sheets("Submition Forms").Select
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell.Value = "N" Then
ActiveCell.Copy
Sheets("Homework").Select
ActiveCell.Select
Selection.PasteSpecial
ActiveCell.Offset(1, 0).Select
Sheets("Submition Forms").Select
ActiveCell.Offset(1, 0).Select
Call FmtDetentions
Call DetentionListAddName
ElseIf ActiveCell.Value = "" Then
End If
Else
Call CorrectData
End If
Loop Until IsEmpty(ActiveCell)
Sheets("Homework").Select
Cells.Select
Range("F3").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
End Sub