LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Condition based copy/paste of range

hello everyone

i m learning alot from this group
i need direction to solve this problm, which i m trying hard but not
able to write xact vba code/macro bcoz m novice

i hav data in two columns

a b

1(x1) 2(y1)
3(x2) 4(y2)
5 6
7 8
9 10
16 17
18 19
20 21
25 27

i want to calucate distance between two sets of data which are in
column "a" and "b"

d = sqrt((x2-x1)^2+(y2-y1)^2))

and if d is =4 or <=-4 then

data set should be copied to next columns wherever this condition not
satisfied

for eg

a b c d e
f

a1 b1 a1 b1 a6 b6
a2 b2 a2 b2 a7 b7
a3 b3 a3 b3 a8 b8
a4 b4 a4 b4
a5 b5 a5 b5
a6 b6
a7 b7
a8 b8
a9 b9


in above example i tried to show dat from a1:b5 ( "d" is less than 4
so copied in column "c" and "d" ,

but value of "d " is . 4 for "a6,b6 & a5,b5"
so copied in next colmn til difference is less than 4
and like wise a9,b9 in next columns

hop i hav made my problm bit clear

hop i wil get some suggestions to write a code
witing for ur replys
many thanx in advance
4 ur time n efort

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to copy and paste based on a condition kathryn462 Excel Discussion (Misc queries) 5 October 14th 08 12:59 AM
Copy and Paste based on Condition EJ Excel Discussion (Misc queries) 1 June 27th 07 11:17 PM
Condition based copy/paste of range [email protected] Excel Programming 1 April 27th 07 12:44 PM
Condition based copy/paste of range [email protected] Excel Programming 0 April 27th 07 05:48 AM
Copy range based on condition Sotomayor Excel Programming 1 September 10th 06 01:11 AM


All times are GMT +1. The time now is 06:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"