Hi Nathan,
Welcome to the forum!!
Note you must wrap any code you post like this...
[CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE]
...though as it's your first post a moderator will do it for you this time.
I think the issue is the way you're setting the x, y and z variables in that x and y are variants but as z is an integer it only has a maximum positive value of 32,767 whereas from 2007 an Excel sheet has 1,048,576 rows so the value you're trying to assign to z is probably more than 32,767 (click here for a great overview on variables).
See if setting those three variables like this helps:
Regards,
Robert
Bookmarks