Hi,
i am extracting a range of values from one excel sheet to another using the for loop and I have come across a complexity to which I will be most grateful for any help.
The conditions that need to be applied to the data to be extracted is
Column K = Not Null
Column Q = Null
If Column N and O are both Null (include in loop)
If Column N and O are both Not Null (include in loop)
If Column N is not Null AND O is Null (exclude from loop)
I am stumped on how to tackle column N and O, any help will be most appreciated:
For iMasterLoop = 2 To (iLoop - 1) Step 1
If xlMainSheet.Range("K" & iMasterLoop & ":K" & iMasterLoop).Value <> "" And _
xlMainSheet.Range("Q" & iMasterLoop & ":Q" & iMasterLoop).Value = "" Then
xlLocalClock.Range("A" & gCount & ":A" & gCount).Value = xlMainSheet.Range("A" & iMasterLoop & ":A" & iMasterLoop).Value
xlLocalClock.Range("B" & gCount & ":B" & gCount).Value = xlMainSheet.Range("B" & iMasterLoop & ":B" & iMasterLoop).Value
xlLocalClock.Range("C" & gCount & ":C" & gCount).Value = xlMainSheet.Range("C" & iMasterLoop & ":C" & iMasterLoop).Value
xlLocalClock.Range("D" & gCount & "

" & gCount).Value = xlMainSheet.Range("K" & iMasterLoop & ":K" & iMasterLoop).Value
xlLocalClock.Range("E" & gCount & ":E" & gCount).Value = (DateDiff("d", xlMainSheet.Range("K" & iMasterLoop & ":K" & iMasterLoop).Value, Now() - xlMainSheet.Range("O" & iMasterLoop & ":O" & iMasterLoop)))
gCount = gCount + 1
End If