I cannot find anything on the net to help me and I've been searching ALL day. I'm trying to insert this FormulaArray into a cell via a userform and it contains a reference to a TextBox Value on that userform. For this example, I'm entering Driver, Joe into the TextBox
.Range("B" & irow).FormulaArray = "=SUMPRODUCT(--('Period 1'!B13:B3000=" & addDriverName.Value & "),'Period 1'!C13:C3000)"
It's taking the correct Value but it's not putting quotes around the TextBox Value.
=SUMPRODUCT(--('Period 1'!B13:B3000=Driver, Joe),'Period 1'!C13:C3000)
So, I figured I'd just add & """ before and after:
.Range("B" & irow).FormulaArray = "=SUMPRODUCT(--('Period 1'!B12:B3000=" & """ & addDriverName.Value & """ & "),'Period 1'!C12:C300)"
Thinking it would add the quotes... Now it comes back with
=SUMPRODUCT(--('Period 1'!B13:B3000=" & addDriverName.Value & "),'Period 1'!C13:C3000)
Can anyone help me please?
Thank you very much, in advance.
Jeff
Bookmarks