Help!Routing Combination

wydn

New Member
Joined
Jun 14, 2011
Messages
7
Hey guys..
I am a newbie in this forum.
I want to ask about combination procedure for following problem:
I have 9 routes:
1. AB
2. BC
3. AD
4. AC
5. CD
6. DE
7. AE
8. AB
9. AC
I want to display all possible combination of these routes with contraint the routes must include node ABCDE. I thought it will be more easier to do that using vba macro excel.
Thanks for the help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
thx u for the help...the code was work for me.
but i need another function so that i can count the number of character in one cell.
i.e cell A1 contain letters ABDAB
how to count how many "A" in that cells so can I get "2" in cell A2.
:confused:
 
Upvote 0
Thank u my man!!!...
sorry i'm a beginner in VBA.
I need to do that action with 200.000 data.

So how to use that function in VBA so i can use that function for many data.
i.e I put my data in range A1:A200.000.

thanks for the help.
;)
 
Upvote 0
Try this: results in column B

Code:
Sub test()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("B1:B" & LR)
    .Formula = "=LEN(A1)-LEN(SUBSTITUTE(A1,""A"",""""))"
    .Value = .Value
End With
End Sub
 
Upvote 0
thank u bro..That code is working!!!
But I have another problem when i try to do 4 combination.The results are too many so. Whereas I need to do until 8 combination.

I have the procedure to solve that problem, but I can't make the code.I hope u can help or give me another suggestion to solve the problem.

Here my procedure. I'll explain it by example so it easier to understand.
i.e I have letter in range A1:A6.
I need to know all possible combination which is containt letters ABCDE.

DC
AB
AD
CD
CE
E

1. check the first rows
2. check "Is the number of character 5? if yes check "Is the letter
A,B,C,D,E > 1. If yes delete combination. go to second row (repeat step 1 and 2). if no SaveCombination and write in another worksheet.
3.Continue step 2. if the number of character < 5 combine first row to second row. (loop to step 2)

Sorry if my explanation is complicated. That because english is not my basic language.

Thank u for the help!!!
 
Upvote 0

Forum statistics

Threads
1,224,579
Messages
6,179,656
Members
452,935
Latest member
Mickid32

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top