BIGTONE559
Active Member
- Joined
- Apr 20, 2011
- Messages
- 336
I'm having problem with the code going through the loop. it looks like it sets the range. the msgbox says 494,937 but it does not loop through each cell correctly.
It appears that it only enters value for the 494937 row. any thoughts?
It appears that it only enters value for the 494937 row. any thoughts?
Code:
Sub AGQtest()
Dim fDate As Date
Dim dDate As Date
Dim MystRange As Range
Sheets("HallDb").Select
Set MystRange = Worksheets("Halldb").Range("A2").End(xlDown).Rows
MsgBox (MystRange)
dDate = 5 - 1 - 11
fDate = 5 - 22 - 11
Sheets("Halldb").Activate
Application.ScreenUpdating = False
For Each cell In MystRange
If Cells(cell.Row, 3) > dDate And Cells(cell.Row, 3) < fDate Then 'this tests whether or not the cells in the apropriate dates within the given prompt
Cells(cell.Row, 6).Value = 5
Else
Cells(cell.Row, 7).Value = 0
End If
Next cell
End Sub