Before writing values to the sheet, make sure that the dictionary is populated.
Try it like this...

If .Count > 0 Then
    Range("X5").Offset(0, c - 1).Resize(.Count).Value = Application.Transpose(.Keys)
End If