Usedrange is unreliable. I suggest you use:
with Sheets("rawdata")
EndOf2 = .cells(.Rows.Count, "A").End(xlup).Row + 1
End With
instead of
EndOf2 = Sheets("rawdata").UsedRange.Rows.Count + 1