This is my first time using VBA and I'm trying to see what I'm doing wrong here. Does anyone knows why I'm getting this error?
Sub CountHighSales()
Dim i As Integer
Dim j As Integer
Dim nHigh As Integer
Dim cutoff As Currency
cutoff = InputBox("What sales value do you want to check for?")
For j = 1 To 6
nHigh = 0
For i = 1 To 36
If wsData.Range("Sales").Cells(i, j) >= cutoff Then _
nHigh = nHigh + 1
Next i
MsgBox ("For region " & j & ", sales were above " & Format(cutoff, "$0,000") & " on " & nHigh & " of the 36 months.")
Next j
End Sub
wsDatais this the name of your sheet, or its CodeName ? - A.S.H