# EXCEL VBA FOR POSSIBLE COMBINATIONS DEPENDING ON CELLS VALUES

R

#### rehasezer

Hello to all,

I am an excel vba newbie and could not solve my problems to build combinations depending on the values (or datas) at cells. The definition of my problem is in the following:

CELLS FOR COMBINATIONS SOURCE
Col-B Col-C Col-D
2 1 3 4

-------------------------------

Col-B&C Col-D&E Col-F&G Col-H&I Col-J&K Col-L&M Col-N&O
5 Infant(M) Child-1(M) Child-2(M) Child-3(M) Child-4(M) Child-5(M) Child-6(M)
6 From|To From|To From|To From|To From|To From|To From|To
7 0|02,99 03|06,99 07|12,99

* (M) means merged cells, "|" refers seperated cells (not merged)

* No ages defined (blank) in this table after column "H" but may happen according to hotel

The values of B2, C2, D2 may change with respect to room size and "Total Pax" may icrease 5, 6 or more based on the child capacity of room (it is not the total of cells B2 & C2).

At cells 7 ages of children are given (not more than 6 chd at table). So all the possible the combination should be as in below:

Col-B Col-C

As being understood from the combinations table, the combination table should look up Min & Max adult numbers while running. The total can not exceed 4 including the children. So the maximum capacity of room are figured as 1+3 or 2+2 or 3+1. The recurence of same combination are omitted as well. If this can manage bye VBA will be perfect.