pedro-egoli
Well-known Member
- Joined
- Apr 25, 2004
- Messages
- 1,217
- Office Version
- 2016
- Platform
- Windows
Have a macro which I recorded step by step to delete date(from date and time) in one column and data in another so that the only info is at half hourly intervals.
Data is saved in excel and covers info at 5 minute intervals like this in columns A & B
The macro I have at the moment when run delivers the following
The macro itsel is
Is there a shorter macro which will do the same.
Thanks
Pedro
Data is saved in excel and covers info at 5 minute intervals like this in columns A & B
Code:
24-07-11 6:56 14
24-07-11 7:01 26
The macro I have at the moment when run delivers the following
Code:
7:01:59 AM 26
7:31:59 AM 404
The macro itsel is
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 23-12-2010 by Peter
'
'
Columns("A:A").Select
Selection.NumberFormat = "[$-F400]h:mm:ss AM/PM"
Rows("3:7").Select
Selection.Delete Shift:=xlUp
Rows("4:8").Select
Selection.Delete Shift:=xlUp
Rows("5:9").Select
Selection.Delete Shift:=xlUp
Rows("6:10").Select
Selection.Delete Shift:=xlUp
Rows("7:11").Select
Selection.Delete Shift:=xlUp
Rows("8:12").Select
Selection.Delete Shift:=xlUp
Rows("9:13").Select
Selection.Delete Shift:=xlUp
Rows("10:14").Select
Selection.Delete Shift:=xlUp
Rows("11:15").Select
Selection.Delete Shift:=xlUp
Rows("12:16").Select
Selection.Delete Shift:=xlUp
Rows("13:17").Select
Selection.Delete Shift:=xlUp
Rows("14:18").Select
Selection.Delete Shift:=xlUp
Rows("15:19").Select
Selection.Delete Shift:=xlUp
Rows("16:20").Select
Selection.Delete Shift:=xlUp
Rows("17:21").Select
Selection.Delete Shift:=xlUp
Rows("18:22").Select
Selection.Delete Shift:=xlUp
Rows("19:23").Select
Selection.Delete Shift:=xlUp
Rows("20:24").Select
Selection.Delete Shift:=xlUp
Rows("21:25").Select
Selection.Delete Shift:=xlUp
Rows("22:26").Select
Selection.Delete Shift:=xlUp
Rows("23:27").Select
Selection.Delete Shift:=xlUp
Rows("24:28").Select
Selection.Delete Shift:=xlUp
Rows("25:29").Select
Selection.Delete Shift:=xlUp
Rows("26:30").Select
Selection.Delete Shift:=xlUp
Rows("27:31").Select
Selection.Delete Shift:=xlUp
Rows("28:32").Select
Selection.Delete Shift:=xlUp
Rows("29:33").Select
Selection.Delete Shift:=xlUp
Rows("30:34").Select
Selection.Delete Shift:=xlUp
Rows("31:35").Select
Selection.Delete Shift:=xlUp
Rows("32:36").Select
Selection.Delete Shift:=xlUp
Rows("31:80").Select
Selection.Delete Shift:=xlUp
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("K30").Select
End Sub
Is there a shorter macro which will do the same.
Thanks
Pedro