First Error location, starting at the top of the Code
With wsData
Since this is Homework our help will be to help you figure out the errors, not to correct them.

In the VBA Editor (VBIDE), Tools Menu >> Options >> Editor Tab, check every box in the Code Settings Frame.,

Then, with the Debug Menu >> Compile. Recompile after correcting each error until it successfully Compiles.

You have none, but if you did, disable all error handling code until the code Compiles.