northshoreroad
New Member
- Joined
- Jan 5, 2018
- Messages
- 5
Hi all
Very new to VBA and hoping the community can help
I am trying to return the top 30 results from a number of days throughout the year.
There is only one header, at least 30 rows per day and the data has already been sorted. There will be no blank cells.
[TABLE="width: 262"]
<colgroup><col><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Symbol[/TD]
[TD]Date[/TD]
[TD] Open [/TD]
[TD] Close [/TD]
[TD]Change[/TD]
[/TR]
[TR]
[TD]LEJU[/TD]
[TD]1/3/2017[/TD]
[TD] $ 4.70[/TD]
[TD] $ 4.20[/TD]
[TD]-10.64%[/TD]
[/TR]
[TR]
[TD]TWLO[/TD]
[TD]1/3/2017[/TD]
[TD] $ 29.25[/TD]
[TD] $ 26.50[/TD]
[TD]-9.40%[/TD]
[/TR]
[TR]
[TD]WAAS[/TD]
[TD]1/3/2017[/TD]
[TD] $ 24.15[/TD]
[TD] $ 22.06[/TD]
[TD]-8.65%[/TD]
[/TR]
[TR]
[TD]IO[/TD]
[TD]1/3/2017[/TD]
[TD] $ 6.10[/TD]
[TD] $ 5.60[/TD]
[TD]-8.20%[/TD]
[/TR]
[TR]
[TD]TSQ[/TD]
[TD]1/3/2017[/TD]
[TD] $ 10.46[/TD]
[TD] $ 9.63[/TD]
[TD]-7.93%[/TD]
[/TR]
[TR]
[TD]CNDT[/TD]
[TD]1/3/2017[/TD]
[TD] $ 14.84[/TD]
[TD] $ 13.72[/TD]
[TD]-7.55%[/TD]
[/TR]
[TR]
[TD]FN[/TD]
[TD]1/3/2017[/TD]
[TD] $ 41.05[/TD]
[TD] $ 37.98[/TD]
[TD]-7.48%[/TD]
[/TR]
[TR]
[TD]BCEI[/TD]
[TD]1/3/2017[/TD]
[TD] $ 1.05[/TD]
[TD] $ 0.98[/TD]
[TD]-6.67%[/TD]
[/TR]
[TR]
[TD]SGY[/TD]
[TD]1/3/2017[/TD]
[TD] $ 30.52[/TD]
[TD] $ 28.52[/TD]
[TD]-6.55%[/TD]
[/TR]
</tbody>[/TABLE]
The data above is for 1/3/17 until the end of the year. I would like to keep the first 30 rows, and then delete all rows until the next day (1/4/17 and so on). Once onto the next day keep/skip over the first 30 rows and then delete until the next day
Not sure how to put that into VBA language
From what I've read it would look something like this
Sub Keep_30()
I = 2 < this is where the data starts
I + 30 < skip over 30 rows
Delete until next I
End Sub
Thank you for any help you can provide
Very new to VBA and hoping the community can help
I am trying to return the top 30 results from a number of days throughout the year.
There is only one header, at least 30 rows per day and the data has already been sorted. There will be no blank cells.
[TABLE="width: 262"]
<colgroup><col><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Symbol[/TD]
[TD]Date[/TD]
[TD] Open [/TD]
[TD] Close [/TD]
[TD]Change[/TD]
[/TR]
[TR]
[TD]LEJU[/TD]
[TD]1/3/2017[/TD]
[TD] $ 4.70[/TD]
[TD] $ 4.20[/TD]
[TD]-10.64%[/TD]
[/TR]
[TR]
[TD]TWLO[/TD]
[TD]1/3/2017[/TD]
[TD] $ 29.25[/TD]
[TD] $ 26.50[/TD]
[TD]-9.40%[/TD]
[/TR]
[TR]
[TD]WAAS[/TD]
[TD]1/3/2017[/TD]
[TD] $ 24.15[/TD]
[TD] $ 22.06[/TD]
[TD]-8.65%[/TD]
[/TR]
[TR]
[TD]IO[/TD]
[TD]1/3/2017[/TD]
[TD] $ 6.10[/TD]
[TD] $ 5.60[/TD]
[TD]-8.20%[/TD]
[/TR]
[TR]
[TD]TSQ[/TD]
[TD]1/3/2017[/TD]
[TD] $ 10.46[/TD]
[TD] $ 9.63[/TD]
[TD]-7.93%[/TD]
[/TR]
[TR]
[TD]CNDT[/TD]
[TD]1/3/2017[/TD]
[TD] $ 14.84[/TD]
[TD] $ 13.72[/TD]
[TD]-7.55%[/TD]
[/TR]
[TR]
[TD]FN[/TD]
[TD]1/3/2017[/TD]
[TD] $ 41.05[/TD]
[TD] $ 37.98[/TD]
[TD]-7.48%[/TD]
[/TR]
[TR]
[TD]BCEI[/TD]
[TD]1/3/2017[/TD]
[TD] $ 1.05[/TD]
[TD] $ 0.98[/TD]
[TD]-6.67%[/TD]
[/TR]
[TR]
[TD]SGY[/TD]
[TD]1/3/2017[/TD]
[TD] $ 30.52[/TD]
[TD] $ 28.52[/TD]
[TD]-6.55%[/TD]
[/TR]
</tbody>[/TABLE]
The data above is for 1/3/17 until the end of the year. I would like to keep the first 30 rows, and then delete all rows until the next day (1/4/17 and so on). Once onto the next day keep/skip over the first 30 rows and then delete until the next day
Not sure how to put that into VBA language
From what I've read it would look something like this
Sub Keep_30()
I = 2 < this is where the data starts
I + 30 < skip over 30 rows
Delete until next I
End Sub
Thank you for any help you can provide