tagging or labeling variables

Hi.

I am writing a VBA (VBA in Excel) code for testing different combination of 24 variables and recording a result which corresponds to each combination of 24 variables. so actually I have an equation with 24 variables and one result.

so in excel I have one column which contains the 24 variables and the column next to it contains a figure which shows the result. what I need to do is to write loops to change the 24 variables between 1,2, and 3 and then record the result of the equation for each combination of 24 variables. I have written the loops (24 loops) and can record the result for each combination, what I have to do at this stage is to record the combinations which relates to each result. As there is only one result for each combination of 24 variables I was wondering whether I can tag each variable (in each cell) in a way that in the final sheet in the cell next to the result cell I can write for example 111123123111233311121232. This means that after each loop I am taking the values for each variable in 24 cells and put them all together in one cell in the final sheet. These variables are changing in each loop, the label should change as well after each loop so after the completion of the code I can find out which combination relates to which result.

I have tried to define an array or matrix but i couldn't fix the problem.

It would be great if you could give me a hint as I'm really short in time.

This is the input sheet (the code changes the values in the cells in A column after each operation)
A B
1 Result
2
1
1
1
3
2
...

I want the output sheet to look like this:

A B
1211132 Result

I want to put the values in the A column all together in one cell in A column in the output sheet. I should note that the values in column A input sheet are all variables. for example h1, h2, h3, h4 ... so I need a line in the code that for example: Range("A1").value=h1h2h3h4... i know that VBA does not understand it. How can I define this line so that after each operation the value in the cells in the A column (in the output sheet) changes automatically as the variables change.

I have attached an excel file with my macro in it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories