I have a spread sheet with 31 worksheets on it (30 baseball teams, and the 1 to simulate baseball games). I think I have the steps down that I need, but I just have no idea how to turn them into VB code for a Macro
What I'd like it to do is the following (this is just the first half, of finding the data and gathering it).
1) If cell Sheet1!A9 is empty, end macro.
2) Locate the worksheet that has the same name as cell Sheet1!A9 (in this cell, I place the team name, so if it is "SEA", it should go to the worksheet named "SEA", this way I can change it later to any team and the macro can still function)
3) Locate the cell in that worksheet that has the same name as cell Sheet1!B9 (in this cell, I place the batter name, this will always be in the A column).
4) Copy cells Bx:Dx (where x is the number that relates to step 3, so if step 3 finds us cell A17, we copy B17:D17, if step 3 finds A31, we copy B31:D31).
5) Paste into range Sheet1!B1:D1
6) (step 6 - 9 are going to be similar as 2 - 5, but this is for pitcher info). Locate worksheet that has the same name as Sheet1!C9.
7) Locate cell within that worksheet that has the same name as cell Sheet1!D9 (this will also be in the A column, as in the team worksheets, pitchers are below the batters, not off to the side).
8) Copy Bx:Dx
9) Paste into range Sheet1!B2:D2
10) (these will actually be the last steps, but I'd like to be able to test them) Delete row Sheet1!9.
11) repeat marco (until step 1 makes us stop).
If anyone knows the coding for any part of this (like just step 1), that would be of great help.
What I'd like it to do is the following (this is just the first half, of finding the data and gathering it).
1) If cell Sheet1!A9 is empty, end macro.
2) Locate the worksheet that has the same name as cell Sheet1!A9 (in this cell, I place the team name, so if it is "SEA", it should go to the worksheet named "SEA", this way I can change it later to any team and the macro can still function)
3) Locate the cell in that worksheet that has the same name as cell Sheet1!B9 (in this cell, I place the batter name, this will always be in the A column).
4) Copy cells Bx:Dx (where x is the number that relates to step 3, so if step 3 finds us cell A17, we copy B17:D17, if step 3 finds A31, we copy B31:D31).
5) Paste into range Sheet1!B1:D1
6) (step 6 - 9 are going to be similar as 2 - 5, but this is for pitcher info). Locate worksheet that has the same name as Sheet1!C9.
7) Locate cell within that worksheet that has the same name as cell Sheet1!D9 (this will also be in the A column, as in the team worksheets, pitchers are below the batters, not off to the side).
8) Copy Bx:Dx
9) Paste into range Sheet1!B2:D2
10) (these will actually be the last steps, but I'd like to be able to test them) Delete row Sheet1!9.
11) repeat marco (until step 1 makes us stop).
If anyone knows the coding for any part of this (like just step 1), that would be of great help.