ok. Im so grateful to all, zmbd , twinnyfo, Rabbit. for your help. Forgive me , if i didn't represent , at first, the problem properly, because most of time, i've struggled with mathematics.
Please, Would you fix the code bellow in order to work out correctly for a extremelly huge data such as 5000 rows of data? Because, I'm beginner in VBA, and I've got almost nothing in VBA , only the basics of the basic simple concepts.
...
User Profile
Collapse
-
-
What i'm trying to do is to find "any three cells" (in the same row/line) or any three numbers (x,y,z) whose difference is 11 within each row/line in the excel spreedsheet. Any combination of 3 numbers displayed in the input data that meets the condition difference is 11.
I'm struggling with some math, but i give an example what i'm tryng to explain, in the table bellow we can see at left (first 6 rows) the input data, and...Leave a comment:
-
I'm so thankfull to all, twinnyfo, zmbd , Rabbit.
I'm sorry I'm just getting started in VBA, I don´t have any background in programming, forgive me if i didn't illustrate the problem correctly: a code for visual basic/ excel to calculate the exact difference of three numbers (triples) in a extremely large sample, in this example im tryng to find out three numbers (x,y,z) whose difference is 11 , in other words z-y=11 , y-x=11. I'm trying...Leave a comment:
-
Thank you twinnyfo. I´ve benn running some tests and i've just discovered that the code is omitting some results. For example, for the input data:
It should show the following results: (27, 38, 49) ; (3, 14, 25) ; (7, 18, 29) , because the difference of any of these is 11. Looking at these results i guess that is the case when Abs(Cells(lngRo w,...Code:10 27 38 40 49 55 3 14 20 25 40 48 7 9 18 26 29 51
Leave a comment:
-
Please, excuse my ignorance,I don´t have any background in programming, and I'm just getting started in VBA, i think that the code that i posted and your code that's extremely better than mine, share the same idea: to find adjacent values/cells whose difference (absolute value) is 11.
Forgive my ignorance,due to lack of knowledge in vba, i dont know how to fix that problems and I don't exactly know how to make the code do the calculation...Leave a comment:
-
I used the input data below to run your code:
the i used the modified the THEN PART of your code (i write the ehole code that i used):Code:6 11 14 16 21 22 8 11 22 33 44 55 8 10 11 17 20 22 5 12 14 25 30 35 8 17 20 28 32 39
...Code:Sub Listtriples4() Dim lngRow As Long 'just in case you have a huge spreadsheet Dim intCol As Integer lngRow = 1Leave a comment:
-
Im so grateful for your help . I used the input data below to run your code:
Code:6 11 14 16 21 22 8 11 22 33 44 55 8 10 11 17 20 22 5 12 14 25 30 35 8 17 20 28 32 39
I modified the THEN PART of your code by putting [ Cells(lngRow, intCol).Value = "(" & Cells(lngRow, intCol) & ", " & Cells(lngRow, intCol + 1) & ", " & Cells(lngRow, intCol + 2))"...Leave a comment:
-
my reply to the 1st question above: it will generate the following:
(11, 22, 33) (22, 33, 44) (33, 44, 55) and (44, 55, 66) . These three results are correct (11, 22, 33) (22, 33, 44) (33, 44, 55) but this last one here (44, 55, 66) it's wrong because the number 66 doesn't belong to the original input data 8 11 22 33 44 55 i can´t find where 66 came from since it wasn't present in the original input data 8 11 22 33 44 55
...Leave a comment:
-
my reply for the first question: Your description implies z > y > x—is this always the case? my answer is yes. One example for clarifying this point: in the 2nd row/line of first1st.zip there is
8 11 22 33 44 55 in the first1st.zip when you must first SELECT THE AREA OF NUMBERS FOR CALCULATION
and the press CALC it will generate the following:
(11, 22, 33) (22, 33, 44) (33, 44, 55) and (44, 55, 66) . These three...Leave a comment:
-
Finding Exact Difference between Three Numbers
I already created an account and verified my email adress, but when i tried to post my first doubt on ask a question. it displays a message that my post couldn't be submitted.
I tried to post the following below: Im trying a code for visual basic/ excel to calculate the exact difference of three numbers (triples) in a extremely large sample, in this example im tryng to find out three numbers (x,y,z) whose difference is 11 , in other...
No activity results to display
Show More
Leave a comment: