Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Generate data with all combinations

HI,

Please provide help on how to generate data on all comibinations
in an excel I have 3 clumns
Sec - has 4 values
Acc - has 8 values
Type - 4 values

with the available data, i reuqire either an addin or macro or any tiool
that would generate data will all the combinations of values

so, with the above example - excel shoud have: 4 * 8* 4 =128 rows in excel.

how to do it?

Thanks,
Venkat
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Generate data with all combinations

Sub Venkatesh()
sec = Array("sec1", "sec2", "sec3", "sec4")
acc = Array(1, 2, 3, 4, 5, 6, 7, 8)
tipe = Array("t1", "t2", "t3", "t4")
L = 1
For i = 0 To 3
For j = 0 To 7
For k = 0 To 3
Cells(L, 1).Value = sec(i)
Cells(L, 2).Value = acc(j)
Cells(L, 3).Value = tipe(k)
L = L + 1
Next
Next
Next
End Sub

Naturally, put your own values in the array statements.
--
Gary''s Student - gsnu200816


"Venkatesh V" wrote:

HI,

Please provide help on how to generate data on all comibinations
in an excel I have 3 clumns
Sec - has 4 values
Acc - has 8 values
Type - 4 values

with the available data, i reuqire either an addin or macro or any tiool
that would generate data will all the combinations of values

so, with the above example - excel shoud have: 4 * 8* 4 =128 rows in excel.

how to do it?

Thanks,
Venkat

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Generate data with all combinations

excellent. thanks

"Gary''s Student" wrote:

Sub Venkatesh()
sec = Array("sec1", "sec2", "sec3", "sec4")
acc = Array(1, 2, 3, 4, 5, 6, 7, 8)
tipe = Array("t1", "t2", "t3", "t4")
L = 1
For i = 0 To 3
For j = 0 To 7
For k = 0 To 3
Cells(L, 1).Value = sec(i)
Cells(L, 2).Value = acc(j)
Cells(L, 3).Value = tipe(k)
L = L + 1
Next
Next
Next
End Sub

Naturally, put your own values in the array statements.
--
Gary''s Student - gsnu200816


"Venkatesh V" wrote:

HI,

Please provide help on how to generate data on all comibinations
in an excel I have 3 clumns
Sec - has 4 values
Acc - has 8 values
Type - 4 values

with the available data, i reuqire either an addin or macro or any tiool
that would generate data will all the combinations of values

so, with the above example - excel shoud have: 4 * 8* 4 =128 rows in excel.

how to do it?

Thanks,
Venkat

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
How to create a macro in excel so that it can generate a list ofunique records using all permutations and combinations of the data in eachrow ad column Rizwan[_4_] Excel Discussion (Misc queries) 1 August 6th 09 01:44 PM
Help with a formula: Data Combinations Maureno Excel Discussion (Misc queries) 3 October 22nd 08 02:45 PM
generate a random number and use if function to generate new data Dogdoc1142 Excel Worksheet Functions 4 April 26th 06 03:44 AM
Generate table of combinations Gary's Student Excel Programming 5 September 2nd 05 11:58 PM
Generate all possible combinations from three data sets? Flamikey[_6_] Excel Programming 2 October 8th 04 11:20 PM


All times are GMT +1. The time now is 01:11 PM.

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

About Us

"It's about Microsoft Excel"