Adjusting this line would do the trick.

Code:
d = .Range("a1").CurrentRegion.Value2
rather than taking the current region you can explicitly put the range.