Hi!
I have very limited VBA skills but thought of a cool scenario that I was thinking of for my trip. I would like to know how you go about this or if it even possible in VBA, as I can only do very basic things.
I have to travel to 4 cities. In those 4 cities are 3-4 hotels that I can stay in. It does not matter how many nights I stay in each city, but I must visit all 4 cities. It also does not matter which hotel I use by city, but I must use each hotel at least once (in total)- and I also must stay a minimum amount of nights by hotel (in total, table2). I must use up all those nights (constraint). I was wondering if VBA can deliver the cheapest scenario based in the numbers in table:
Table1
CITY HOTEL COST
LA Hilton 167
LA Marriot 174
LA Holiday Inn 149
LA Sheraton 162
NYC Hilton 212
NYC Marriot 199
NYC Holiday Inn 133
NYC Sheraton 168
Chicago Hilton 124
Chicago Marriot 149
Chicago Sheraton 127
Dallas Hilton 134
Dallas Marriot 146
Dallas Holiday Inn 96
Dallas Sheraton 128
Table2
HOTEL NIGHTS
Hilton 4
Marriot 6
Holiday Inn 5
Sheraton 3
Any help would be great!
I have very limited VBA skills but thought of a cool scenario that I was thinking of for my trip. I would like to know how you go about this or if it even possible in VBA, as I can only do very basic things.

I have to travel to 4 cities. In those 4 cities are 3-4 hotels that I can stay in. It does not matter how many nights I stay in each city, but I must visit all 4 cities. It also does not matter which hotel I use by city, but I must use each hotel at least once (in total)- and I also must stay a minimum amount of nights by hotel (in total, table2). I must use up all those nights (constraint). I was wondering if VBA can deliver the cheapest scenario based in the numbers in table:
Table1
CITY HOTEL COST
LA Hilton 167
LA Marriot 174
LA Holiday Inn 149
LA Sheraton 162
NYC Hilton 212
NYC Marriot 199
NYC Holiday Inn 133
NYC Sheraton 168
Chicago Hilton 124
Chicago Marriot 149
Chicago Sheraton 127
Dallas Hilton 134
Dallas Marriot 146
Dallas Holiday Inn 96
Dallas Sheraton 128
Table2
HOTEL NIGHTS
Hilton 4
Marriot 6
Holiday Inn 5
Sheraton 3
Any help would be great!

Last edited: