hcparsons12
New Member
- Joined
- Jul 1, 2021
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
Hey everyone,
Keep in mind that I am very new to VBA, but not Excel. I've been attempting to learn VBA and apply it to my projects only over the past week or so. Currently, I am trying to write a code that searches across the table headers in a "Per Game" Sheet for a match to a changing reference in the "Player Search" Sheet. I have gotten the loops to work in that the macro runs through the correct rows or columns in each Sheet until it finds a match, but I cannot figure out how to tell the macro what to do when it finds said match. When it finds the match in the "Per Game" Sheet, I need it to take the average of the 540 rows beneath it. Then, reset and move on to the next match and do the same until reaching the bottom of "J5:J24" range, where the value of the averages go, in the "Player Search" Sheet. I'll attach a picture of my code. When I run it, I usually get a "424" error for object required.
Keep in mind that I am very new to VBA, but not Excel. I've been attempting to learn VBA and apply it to my projects only over the past week or so. Currently, I am trying to write a code that searches across the table headers in a "Per Game" Sheet for a match to a changing reference in the "Player Search" Sheet. I have gotten the loops to work in that the macro runs through the correct rows or columns in each Sheet until it finds a match, but I cannot figure out how to tell the macro what to do when it finds said match. When it finds the match in the "Per Game" Sheet, I need it to take the average of the 540 rows beneath it. Then, reset and move on to the next match and do the same until reaching the bottom of "J5:J24" range, where the value of the averages go, in the "Player Search" Sheet. I'll attach a picture of my code. When I run it, I usually get a "424" error for object required.