User Profile

Collapse

Profile Sidebar

Collapse
brunoff
brunoff
Last Activity: May 22 '19, 01:20 PM
Joined: May 7 '19
Location: BRUSSELS
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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.
    ...
    See more | Go to post
    Last edited by brunoff; May 19 '19, 03:09 PM. Reason: ok

    Leave a comment:


  • 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...
    See more | Go to post
    Last edited by brunoff; May 18 '19, 08:51 PM. Reason: ok

    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...
    See more | Go to post

    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:
    Code:
    10	27	38	40	49	55
     3	14	20	25	40	48
    7	9	18	26	29	51
    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,...
    See more | Go to post
    Last edited by brunoff; May 17 '19, 02:06 PM. Reason: ok

    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...
    See more | Go to post

    Leave a comment:


  • 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
    the i used the modified the THEN PART of your code (i write the ehole code that i used):

    Code:
    Sub Listtriples4()
        Dim lngRow  As Long 'just in case you have a huge spreadsheet
        Dim intCol  As Integer
    
        lngRow = 1
    ...
    See more | Go to post
    Last edited by twinnyfo; May 9 '19, 10:01 PM. Reason: Please stop posting 95 lines of sample data

    Leave 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))"...
    See more | Go to post
    Last edited by twinnyfo; May 9 '19, 05:17 PM. Reason: No need for 95 lines of SAMPLE data

    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

    ...
    See more | Go to post
    Last edited by brunoff; May 8 '19, 09:55 PM. Reason: correction

    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...
    See more | Go to post

    Leave a comment:


  • brunoff
    started a topic Finding Exact Difference between Three Numbers

    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...
    See more | Go to post
No activity results to display
Show More
Working...