I don't see anything wrong with your code. I'm gonna guess that it's your data
that doesn't match what you want -- maybe there's an extra space
(leading/trailing) in that field.
You could check it again or write your code to eliminate those extra spaces:
With Worksheets(strSheetName)
For iDSLineCounter = 1 To 20
If Trim(LCase(.Cells(4 + iDSLineCounter, 10).Value)) _
= LCase("Y") Then
' *** Copy Bed Number
.Cells(4 + iDSLineCounter, 1).Copy
Worksheets("Isolation").Cells(5 + iListCounter, 3).PasteSpecial
_
Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
' *** Copy Patient Name
.Cells(4 + iDSLineCounter, 2).Copy
Worksheets("Isolation").Cells(5 + iListCounter, 4).PasteSpecial
_
Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
iListCounter = iListCounter + 1
End If
Next iDSLineCounter
end with
(I added trim() and compared using lcase() on both sides of the comparison
operator.)
The with/end with saves some typing and (I think) makes it easier to read.