Consulting

Results 1 to 2 of 2

Thread: Loop to combine data in 2 columns and insert string every 145 combinations

  1. #1
    VBAX Regular
    Joined
    Apr 2012
    Posts
    22
    Location

    Loop to combine data in 2 columns and insert string every 145 combinations

    I have 2 columns of data (columns A and B). Each column has 1042 rows of data (rows 2 through 1043). I am trying to perform the following steps. It should end up creating 543,403 combinations.

    1) For each row in column A, divide the data in A with every row of data in column B starting with Offset(0,1) from the current row in column A.

    For example, the data point in A10 would end up being divided by B10,B11,B12……B1043. Each division is one combination, so A10/B10 is one combination, A10/B11 is another, etc.

    2) For every 145 combinations created, I need to insert the value into a website. I can already put the data into the website as long as I can use a string, but I don’t know how to get the above process to input the string after every 145 combinations and then pick up where it left off with the combinations. Maybe it would be best to set the string every time as the current combination and input 145 times.

    Thank you in advance.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    [vba]For each CelA in Range("A2:A" & LastRowA)
    b=145
    Do
    Val = Cstr(CelA + Range("B" & b))
    'Put Val on Website
    b= b+145
    Loop until b > LastRowA
    Next CelA
    [/vba]
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •