Which sheet are you trying to get the last/next row for?

Which sheet is active when you run the code?

Since this line doesn't reference any sheet VBA will use whatever sheet is active.
[vba]
LastRow = Range("A65536").End(xlUp).Row
[/vba]