Data Split and graph problem
Hi
Thats great, it splits the data, i.e puts a new row in between each
set. It then creates the new worksheets where it will paste the data,
however the worksheets remain blank, as it doesn't paste the data to
them. Any Ideas?
Thanks
Joseph Crabtree
On Dec 12, 2:42 pm, Nik wrote:
joecrabtree wrote:
What I want to do is split the data if there is a difference between
two adjacent times of greater than 10 minutes. So for example where I
have put a line break in the data - this is where it would be split. I
then want each 'split' set of data to be put in a new worksheet, and a
chart created for each set of data. The number of splits can vary for
each set of data.The following will split the data as you've described.
Where do you wan t the charts to go, and what sort of chart do you want?
I've assumed no title rows on the data.
HTH, Nik
-------------------
Sub NikTest()
Dim MyRow As Integer
Dim a1Cell As Range
Set a1Cell = Sheet1.Range("a1")
allrows = Sheet1.UsedRange.Rows.Count
For MyRow = allrows - 1 To 1 Step -1
'Working upwards - always seems a good idea when inserting rows.
If a1Cell.Offset(MyRow, 0) - a1Cell.Offset(MyRow - 1, 0) (1 /
144) Then
'We have a 10 minute gap between myrow and the row above it.
a1Cell.Offset(MyRow, 0).EntireRow.Insert
a1Cell.Offset(MyRow + 1, 0).CurrentRegion.Copy
'End With
With sheets.Add
.Paste Destination:=Range("a1")
End With
End If
Next
a1Cell.CurrentRegion.Copy
With sheets.Add
.Paste Destination:=Range("a1")
End With
End Sub
|