maverickmonster
Programmer
Everytime I run this code on sheet3 i get a type mismatch and i dont know why ?
Sub count()
Dim date1 As String
Dim salary As String
n = 2149
start_row = 9
calc_row = start_row - 1
For Row_in = 1 To n
counter = 0
For i = 91 To 6 Step -4
date1 = Sheets(3).Cells(Row_in + calc_row, i - 1).Value
salary = Sheets(3).Cells(Row_in + calc_row, i).Value
'check if blank
If Len(date1) <> 0 Then
counter = counter + 1
If counter = 6 Then
counter = 0
'bomb to next line
GoTo continue_next
End If
cnt = counter
'need to print out last 5 entries
Sheets(3).Cells(Row_in + calc_row, 93 + (cnt * 2)).Value = date1
Sheets(3).Cells(Row_in + calc_row, 93 + (cnt * 2) + 1).Value = salary
End If
Next i
continue_next:
Next Row_in
End Sub