I'm working on a macro to make an exported report more useful. My intentions are to:
Here's what I have so far:
I'm working through this and having a few issues. Hoping to get some input from the experts on this forum.
The columns delete works fine (that was easy).
The worksheet copy portion does work, but it copied all sheets, meaning it duplicated the TeamList and Main sheets which I didn't really want it to do.
I'm researching the rest and I'm sure will post back with more questions.
Thank you!
- Delete unnecessary columns
- make 30 new worksheets based on the names of "teams" and copy the data from the first sheet to those
- Now each worksheet has extra rows, delete the extra rows based on the value in the TeamName column
- Take an average from the "Points Scored" column of each sheet
- Show the "high number" from the "Points Scored" column of each sheet
- Take a count for the number of games from each "team" sheet
- There are different statuses for each team, would like to take a count for each status for each team and add them to the summary worksheet.
Here's what I have so far:
Code:
Sub DV_Macro()
'Delete unnecessary columns
Columns(4).EntireColumn.Delete
Columns(4).EntireColumn.Delete
Columns(5).EntireColumn.Delete
Columns(10).EntireColumn.Delete
Columns(10).EntireColumn.Delete
Columns(10).EntireColumn.Delete
Columns(10).EntireColumn.Delete
Columns(12).EntireColumn.Delete
Columns(12).EntireColumn.Delete
Columns(12).EntireColumn.Delete
'Copy worksheet Main to individual team worksheets
Dim i As Integer
Dim ws As Worksheet
Dim sh As Worksheet
Set ws = Sheets("Main")
Set sh = Sheets("TeamList")
Application.ScreenUpdating = 0
For i = 2 To Range("B" & Rows.Count).End(xlUp).Row
Sheets("Main").Copy After:=sh
ActiveSheet.Name = sh.Range("B" & i).Value
Next i
End Sub
I'm working through this and having a few issues. Hoping to get some input from the experts on this forum.
The columns delete works fine (that was easy).
The worksheet copy portion does work, but it copied all sheets, meaning it duplicated the TeamList and Main sheets which I didn't really want it to do.
I'm researching the rest and I'm sure will post back with more questions.
Thank you!