Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default multiple combinations

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
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







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default multiple combinations

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default multiple combinations

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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple columns of data, reporting Means of specific combinations Steve[_19_] Excel Discussion (Misc queries) 2 May 18th 09 08:16 PM
Adding, multiple datasets to include all combinations K Excel Worksheet Functions 3 February 4th 09 09:35 AM
lookups with multiple possible combinations KWhamill Excel Worksheet Functions 2 June 10th 08 03:19 PM
fit multiple values into specific value (combinations?) Travis Excel Worksheet Functions 4 April 8th 07 08:32 PM
get a value from multiple criteria combinations ladygr Excel Worksheet Functions 5 February 7th 07 10:19 PM


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"