View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Martin is offline
external usenet poster
 
Posts: 336
Default multiple combinations

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 X65000 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.


"kumar" wrote:

Martin,

Thanks, please help to "add code to store on same page" please

"Martin" wrote in message
...
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.



"kumar" wrote:

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