Hello,
I am getting an error on the line in red. Can't figure out why?? Something wrong with my syntax. Uggg. I'm trying to put a cell value into a variable called ENDHONORS. The cell value comes from a Msgbox entry and a line counter (i).
Any help would be much appreciated.
Thanks,
Bonnie
Sub HHPP()
With Sheets("WORKBOOK")
STUDENTcount = Sheets("WORKBOOK").Range("C" & 1).Value
lFinalRow = .Cells(.Rows.Count, "B").End(xlUp).Row
Set rngColA = .Range(.Cells(1, "B"), .Cells(lFinalRow, "B"))
End With
MsgBox "Number of students " & lFinalRow
Dim Honors As Integer
Dim HighPass As Integer
Dim Pass As Integer
Dim ENDHONORS As Double
Dim ENDHIGHPASS As Double
Honors = lFinalRow * 0.45
HighPass = lFinalRow * 0.4
Pass = lFinalRow * 0.15
HonorsHighPass = Honors + HighPass
MsgBox "honors count " & Honors
'MsgBox Honors
' Go through the rows
Sheets("WORKBOOK").Select
'** For Each cell In rngColA.Cells
Dim Selcol As String
Selcol = Application.InputBox("Enter Column code containing grades")
For i = 2 To lFinalRow
'Which column should be used to make the determination
If i = Honors Then ENDHONORS = Range(Selcol & i).Values
If i = Honors Then MsgBox "End of honors range " & ENDHONORS
If i = HonorsHighPass Then ENDHIGHPASS = Range(Selcol & i).Values
If i = HonorsHighPass Then MsgBox "End of High pass range " & ENDHIGHPASS
'
Next i
End Sub
I am getting an error on the line in red. Can't figure out why?? Something wrong with my syntax. Uggg. I'm trying to put a cell value into a variable called ENDHONORS. The cell value comes from a Msgbox entry and a line counter (i).
Any help would be much appreciated.
Thanks,
Bonnie
Sub HHPP()
With Sheets("WORKBOOK")
STUDENTcount = Sheets("WORKBOOK").Range("C" & 1).Value
lFinalRow = .Cells(.Rows.Count, "B").End(xlUp).Row
Set rngColA = .Range(.Cells(1, "B"), .Cells(lFinalRow, "B"))
End With
MsgBox "Number of students " & lFinalRow
Dim Honors As Integer
Dim HighPass As Integer
Dim Pass As Integer
Dim ENDHONORS As Double
Dim ENDHIGHPASS As Double
Honors = lFinalRow * 0.45
HighPass = lFinalRow * 0.4
Pass = lFinalRow * 0.15
HonorsHighPass = Honors + HighPass
MsgBox "honors count " & Honors
'MsgBox Honors
' Go through the rows
Sheets("WORKBOOK").Select
'** For Each cell In rngColA.Cells
Dim Selcol As String
Selcol = Application.InputBox("Enter Column code containing grades")
For i = 2 To lFinalRow
'Which column should be used to make the determination
If i = Honors Then ENDHONORS = Range(Selcol & i).Values
If i = Honors Then MsgBox "End of honors range " & ENDHONORS
If i = HonorsHighPass Then ENDHIGHPASS = Range(Selcol & i).Values
If i = HonorsHighPass Then MsgBox "End of High pass range " & ENDHIGHPASS
'
Next i
End Sub