Hello,
I’m trying to streamline my code and cleanup my worksheet a bit if possible.
I have a textbox (txtYTD) in a UserForm (frmPITI) that displays the sum of a range. I can get this to work if I sum the range; place the value in a cell; then populate the textbox with the value in the cell.
Here’s a snipit of the code that works:
However, I like to do this directly from VBA without having to populate a cell (i.e., P25). That is, something like txtYTD. Formula = "=Sum(U33:U2033)".
Any suggestions?
Thanks for viewing,
Steve K.
I’m trying to streamline my code and cleanup my worksheet a bit if possible.
I have a textbox (txtYTD) in a UserForm (frmPITI) that displays the sum of a range. I can get this to work if I sum the range; place the value in a cell; then populate the textbox with the value in the cell.
Here’s a snipit of the code that works:
VBA Code:
Range("P25").Formula = "=Sum(U33:U2033)"
txtYTD = Range("P25")
However, I like to do this directly from VBA without having to populate a cell (i.e., P25). That is, something like txtYTD. Formula = "=Sum(U33:U2033)".
Any suggestions?
Thanks for viewing,
Steve K.