Hi all,
a stupid (I guess) problem - I cannot get my Sub() to work if I concatenate a "*" wildcard to a string.
Code that works
Code that doesn't work
Here is the sheet where I lift strings into VB array, AMOUNT is the cell where I need to write back into:
<tbody>
</tbody>
It is a part of a larger procedure that compares two 2 dimensional arrays (string to another string) and if it finds a match it adds to a temporary SUM. When done comparing all strings, it should write back to a range but it writes all zeroes if I use "*" version".
Why do I need a "*"? Because it is possible that there are a few similar strings that I want summed and written into one row.
Example:
Belgium_gdn_january_np_(FL) 500.00
Belgium_gdn_january_np_(EN) 750,00
Belgium_gdn_january_np_(NL) 630.00
I want it summed into row #x, that has the string
Belgium_gdn_january_np 1880.00
Thanks!
a stupid (I guess) problem - I cannot get my Sub() to work if I concatenate a "*" wildcard to a string.
Code that works
Code:
For i = 1 To StringsCount
arrStrings(i, 1) = .Range("A" & i + k).Value & "_" & .Range("C" & i + k).Value & "_" & .Range("D" & i + k).Value & "_" & .Range("E" & i + k).Value
arrStrings(i, 2) = .Range("A" & i + k).Row
k = k + 11
Next i
Code that doesn't work
Code:
For i = 1 To StringsCount
arrStrings(i, 1) = .Range("A" & i + k).Value & "_" & .Range("C" & i + k).Value & "_" & .Range("D" & i + k).Value & "_" & .Range("E" & i + k).Value[COLOR=#ff0000] [B]& "*"[/B][/COLOR]
arrStrings(i, 2) = .Range("A" & i + k).Row
k = k + 11
Next i
Here is the sheet where I lift strings into VB array, AMOUNT is the cell where I need to write back into:
Market | channel | campaign | product | AMOUNT |
Belgium | gdn | january | np |
<tbody>
</tbody>
It is a part of a larger procedure that compares two 2 dimensional arrays (string to another string) and if it finds a match it adds to a temporary SUM. When done comparing all strings, it should write back to a range but it writes all zeroes if I use "*" version".
Why do I need a "*"? Because it is possible that there are a few similar strings that I want summed and written into one row.
Example:
Belgium_gdn_january_np_(FL) 500.00
Belgium_gdn_january_np_(EN) 750,00
Belgium_gdn_january_np_(NL) 630.00
I want it summed into row #x, that has the string
Belgium_gdn_january_np 1880.00
Thanks!