I have tried a variety of lines of code to convert a textBox value so it can be read by the SUMIF function in a WS. but without success
I have a cashflow sheet into which currency formatted transactions are added via a userform.
Transactions are added to the ws with a "Pending" indicator which is subsequently altered to "Paid". I am using SUMIF to total the value of all "Pending" transactions and then adjust the current balance with this amount. The function works fine when I enter amounts directly into the worksheet, but these are not recognised if they are entered from the UserForm.
I appreciate that this is perhaps because by nature the value in a textbox is "Text" format but i have managed to get some functions to work with currency values from a textbox in other worksheets.
Is there some other method (I have tried using cDbl) to format the textbox values so thay can be recognised by SUM and SUMIF functions in the Worksheet
I have a cashflow sheet into which currency formatted transactions are added via a userform.
VBA Code:
Private Sub txtTransactionAmountDebit_Exit(ByVal Cancel As MSForms.ReturnBoolean)
txtTransactionAmountDebit.Value = Format(txtTransactionAmountDebit.Value, "Currency")
End Sub
Transactions are added to the ws with a "Pending" indicator which is subsequently altered to "Paid". I am using SUMIF to total the value of all "Pending" transactions and then adjust the current balance with this amount. The function works fine when I enter amounts directly into the worksheet, but these are not recognised if they are entered from the UserForm.
I appreciate that this is perhaps because by nature the value in a textbox is "Text" format but i have managed to get some functions to work with currency values from a textbox in other worksheets.
Is there some other method (I have tried using cDbl) to format the textbox values so thay can be recognised by SUM and SUMIF functions in the Worksheet