LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
PST PST is offline
external usenet poster
 
Posts: 29
Default Debug.Print convert vba

hello

who can convert that into vba

the goal is to find the index of the combination

Index Mapping

By creating a MAPPING function (CombinationToIndex) that assigns an
INDEX value to each combination or permutation according to its position
in the full list, we can represent individual combinations by simple
numbers.

With an inverse function (IndexToCombination) that returns the
combination for a given index value, we can then generate any subset of
all possible combinations from a given starting point like this:

Code:
StartIndex = CombinationToIndex(50, 6, "1, 7, 23, 35, 47, 49")
For CombNo = StartIndex To StartIndex + 99
Debug.Print IndexToCombination(50, 6, CombNo)
Next

thank you
 
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
question about debug.print Gary Keramidas[_4_] Excel Programming 4 September 29th 05 01:14 AM
place output of several debug.print statements on the same line [email protected] Excel Programming 1 August 24th 05 08:40 PM
debug.print range "full" address Patti[_2_] Excel Programming 5 July 6th 05 09:27 PM
Debug.Print in a WITH procedure? Toby Erkson[_3_] Excel Programming 4 December 15th 04 10:05 PM
Debug.Print ExcelMonkey[_80_] Excel Programming 1 February 6th 04 04:04 PM


All times are GMT +1. The time now is 07:14 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"