Hi there,i'm new to VB and need some help to write a looping script .
I need to write a macro in excel to multiply two column of data.The way I would like to multiply them are as below. Assume A and B are the two columns and 1,2,3,4..represent the data in each rows.
A1,A2,A3,A4.....B100
B1,B2,B3,B4.....B100
I would like to multiply them: A1*B1, A1*B2, A1*B3, A1*B4...A1*B100. After I finish with A1, I will continue with A2 ; A2*B1,A2*B3,A2*B4...A2*B100. This process will keep going with A3,A4...until A100...
Can someone please show me a simple script to perform this? many thanks in advance
Phew! Sounds as though you could end up with a might big number! :)
If you know the size of the selection, you could just use a couple of nested FOR loops. Something along the lines of...
 For Col1 = 1 To N

For Col2 = 1 To N

Multiply ActiveSheet.Cells(1,Col1).Value by Multiply ActiveSheet.Cells(2,Col2).Value

Next

Next
Note that this is not the exact syntax, just the overall idea.