multiple combinations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would do something like this:
For A=1 to 15 'Division
For B=1 to 150 'CC
For C=1 to 700 'GL
AcctCode=ActiveCell.Offset(A,0).Value & _
ActiveCell.Offset(B,1).Value & _
ActiveCell.Offset(C,2).Value
'Add code to store this new value somewhere
Next C
Next B
Next A

This assumes that the three elements you describe are in consecutive
columns. Keep in mind that you will have over 1.5Million codes (15*150*700).


Hope this helps.
 
Because you will be producing 1.5 million codes, you will need over 24 full
columns to hold all those codes. This will start storing codes in the Column
E starting in row 1, then move to more columns as needed.

1) Add these lines before the first For loop
OutCol=5 '5=Column E; Change this value to start in a different column
X=0

2) Add these lines where noted in my original suggestion
X=X+1
If X>65000 Then 'If you want less than 65000 entries per column, change
OutCol=OutCol+1
X=1
End If
Cells(X,OutCol).Value=AcctCode

Good luck.
 
Please assisit with a macro to solve this:


Division CC GL element

XYZ 120 10250
DEF 225 12500
ABC 365 30200
runs to runs to runs to
15 150 700


Each district and CC combines with GL element and produces a accounting code

means 15* 150*700 codes want to produce all codes


Pleasehelp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top