So I have a bit of code which I want to set the range to loop through and post back all instances where it meets a certain criteria.
This works fine when my code is like
However I want to do the same thing but irregardless of the value in M (so I want the range to start as M3, and then loop through until the value is empty)
how do I set it as that?
I've tried rngresolved = .range("M3") but the code falls down at the .findnext part (obviously), I tried changing that to rngresolved = rngresolved.Offset(1, 0) but no success.
This works fine when my code is like
Code:
With ws1.Range("M3:M" & lngLastRow)
Set rngresolved = .Find("Yes", LookIn:=xlValues)
If Not rngresolved Is Nothing Then
rngresolved1 = rngresolved.Address
Do
If Sheets("MainMenu").cboShift.Value = "AM" Then
If Format(CDate(rngresolved.Offset(, 1)), "dd/mm/yyyy") = Format(Date, "dd/mm/yyyy") _
And Format(rngresolved.Offset(, 2), "hh:mm") >= Format("02:00", "hh:mm") _
And Format(rngresolved.Offset(, 2), "hh:mm") < Format("16:00", "hh:mm") Then
'Lots of specification for where everything posts to
Set rngresolved = .FindNext(rngresolved)
Loop While Not rngresolved Is Nothing And rngresolved.Address <> rngresolved1
End With
However I want to do the same thing but irregardless of the value in M (so I want the range to start as M3, and then loop through until the value is empty)
how do I set it as that?
I've tried rngresolved = .range("M3") but the code falls down at the .findnext part (obviously), I tried changing that to rngresolved = rngresolved.Offset(1, 0) but no success.