View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default pasting data in different columns

Sub splitcol()

LastRowC = Cells(Rows.Count, "C").End(xlUp).Row + 1
LastRowE = Cells(Rows.Count, "E").End(xlUp).Row + 1

d = Sqr((r.Value - r.Offset(-1, 0).Value) ^ 2 + _
(r.Offset(0, 1).Value - r.Offset(-1, 1).Value) ^ 2)
If Abs(d) 10 Then
Cells(LastRowC, "C") = r.Offset(-1, 1).Value
Cells(LastRowC, "D") = r.Value
Else
Cells(LastRowE, "E") = r.Offset(-1, 1).Value
Cells(LastRowE, "F") = r.Value

End If


End Sub


" wrote:

hello evrybody.......

i m trying to fix this prblem for last few days

i have data in col.A , col.B,
say i hav 10 values [in cloumns above]
and wat i wanted to do with these values is to copy in different
columns "based on condition"

"My conditions is "

For Each r In myRange
d = Sqr((r.Value - r.Offset(-1, 0).Value) ^ 2 + (r.Offset(0, 1).Value
-
r.Offset(-1, 1).Value) ^ 2)
If Abs(d) 10 Then
then copy them to col.C, col.D and so on

say if first 5 values satisfy that condition then copy them to col.C,
col.D

NOW if 6 value donot satsfi the condition then copy it to columnE n
the condition is satisfied upto 8 value so copy the value of colA ,
colB in =====ColE,ColF

again 9 value do not satisfy copy it to next column ColmnG , ColH

hope i get some help from this forum
waiting 4 ur replys
Many thanx in advance