I have a hidden worksheet ("RawDataSheet") that pulls from a database, on which column "O" contains the month, i.e. August, September, etc., but not necessarily ALL months. I've written a short macro that finds the distinct months in "O" and copies/pastes them into another worksheet ("CurrentProjects") as headings in column A with a blank row beneath, but now I need to go back and find all the rows that contain/match each month heading, copy columns A thru E of those rows, and paste them underneath each of the headings.
There will always be a variable number of headings/months and rows---for example, currently I have 10 rows that would be copied under the "August" heading, and 13 under "September". But next week, I may have August, September, and October as months that were unique values from "O" on "RawDataSheet", and any number of rows associated with each.
It looks similar to this on "CurrentProjects" sheet I'm pasting to, after my macro copies the month unique values:
[TABLE="width: 470"]
<tbody>[TR]
[TD="class: xl65, width: 625, bgcolor: transparent, colspan: 5"]Sales Report
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #4F81BD"]DetailNumber
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]StreetAddress
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]City
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]StateProvince
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]ProjectName
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]August
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]September
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
There will always be a variable number of headings/months and rows---for example, currently I have 10 rows that would be copied under the "August" heading, and 13 under "September". But next week, I may have August, September, and October as months that were unique values from "O" on "RawDataSheet", and any number of rows associated with each.
It looks similar to this on "CurrentProjects" sheet I'm pasting to, after my macro copies the month unique values:
[TABLE="width: 470"]
<tbody>[TR]
[TD="class: xl65, width: 625, bgcolor: transparent, colspan: 5"]Sales Report
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #4F81BD"]DetailNumber
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]StreetAddress
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]City
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]StateProvince
[/TD]
[TD="class: xl67, bgcolor: #4F81BD"]ProjectName
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]August
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]September
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]