Doublemandal
12-02-2007, 11:50 AM
I am just a newbie cutting my teeth, so if the following appears simple, forgive me.
I have created the following Sub procedure, but I running into an application error 1024:
Sub ProcessKI()
Dim Count As Integer
For Count = 1 To 200
If Range("M8").Offset(Count - 1, 0) And Range("N8").Offset(Count - 1, 0) > 0 Then
Range("M8").Offset(Count - 1, 0).Select
Selection.Copy
Sheets("D").Select
Range("C3").Offset(Count - 1, 0).Select
ActiveSheet.Paste
Range("T8").Offset(Count - 1, 0).Select
Selection.Copy
Sheets("D").Select
Range("D3").Offset(Count - 1, 0).Select
Selection.Copy
End If
Next Count
End Sub
--------------------------
What I am trying to do, is to take a Date from the M column and N column and find out whether both have been filled out. If so, then I want to copy the Date from the M column and copy the difference in days between M and N found in column T. If either $M or $N or both have no date, then I do not want to copy either $M or $T. This is to continue down for 200 cells.
The reasoning, is that the information from $M is plotted on an X-axis versus $T plotted on the Y-axis on another sheet then transfer to a chart.
Any thoughts please?
I much appreciate any help.
Robert
I have created the following Sub procedure, but I running into an application error 1024:
Sub ProcessKI()
Dim Count As Integer
For Count = 1 To 200
If Range("M8").Offset(Count - 1, 0) And Range("N8").Offset(Count - 1, 0) > 0 Then
Range("M8").Offset(Count - 1, 0).Select
Selection.Copy
Sheets("D").Select
Range("C3").Offset(Count - 1, 0).Select
ActiveSheet.Paste
Range("T8").Offset(Count - 1, 0).Select
Selection.Copy
Sheets("D").Select
Range("D3").Offset(Count - 1, 0).Select
Selection.Copy
End If
Next Count
End Sub
--------------------------
What I am trying to do, is to take a Date from the M column and N column and find out whether both have been filled out. If so, then I want to copy the Date from the M column and copy the difference in days between M and N found in column T. If either $M or $N or both have no date, then I do not want to copy either $M or $T. This is to continue down for 200 cells.
The reasoning, is that the information from $M is plotted on an X-axis versus $T plotted on the Y-axis on another sheet then transfer to a chart.
Any thoughts please?
I much appreciate any help.
Robert