Hello,
If someone could possible help on this I would be very greatful.
I have reems of data in Excel (tidal data). I'm looking to get the highs/lows taken out fo the data.
I've worked out a way to have a moving average, but now need to create a VBA macro which will:
1) Search for a specific value (say 0 - my moving average puts a 0 next to specific rows in the data).
(maybe there is a better way to look for the higs and lows?)
2) copy the row (or 4 values from it) to the left of the 0 found
3) Past them in a new sheet, or different location - say the top on the right of all the data, or specified area.
4) not have empty rows in the pasted areas (so i gues delete empty row in this area).
I've been playing with VBA now, but struggling.
So far I;ve got:
Sub processcells2()
For Each cell In slecetion
If cell.Value = 0 Then
ActiveCell.Offset(0, -3).Range("a1:b1").Copy Range(ActiveCell.Offset(0, 4))
End If
Next cell
End Sub
With (but this deletes all the empty rows in the sheet) So not really helping.
Sub DeleteEmptyRow()
LastRow = ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For x = LastRow To 1 Step -1
If Application.CountA(Rows(x)) = 0 Then Rows(x).Delete
Next x
End Sub
But this is not working. I was hoping to compile all the small parts into one operation.
Thanks you for any assistance possible. Clint 16
Configuration: Windows XP Internet Explorer 6.0
It appears I've got it sorted out:
|