userform issues

  • The following macro save data from userform back to the worksheet. Unfortunately (1,7),(1,9),(1,11),(1,13),(1,15) & (1,17) have formula's in the worksheet. I need to know the method of saving the formula's back to the worksheet instead of just the values. Any help is appreciated.


    Thanks.



    vaData(1, 1) = txProduct.Value
    vaData(1, 2) = txItemNumber.Value
    vaData(1, 3) = txLocation.Value
    vaData(1, 4) = txCatagory.Value
    vaData(1, 5) = txUnitPrice.Value
    vaData(1, 6) = txBegInv.Value
    vaData(1, 7) = txBegInvCost.Value
    vaData(1, 8) = txPur1.Value
    vaData(1, 9) = TxPur1Cost.Value
    vaData(1, 10) = txPur2.Value
    vaData(1, 11) = txPur2Cost.Value
    vaData(1, 12) = txEndInv.Value
    vaData(1, 13) = txEndInvCost.Value
    vaData(1, 14) = txUseWeek.Value
    vaData(1, 15) = txUseWeekCost.Value
    vaData(1, 16) = txUsage.Value
    vaData(1, 17) = txUsageCost.Value
    rgData.Value = vaData

  • If the formula is calculating data that is being entered from the form do not have any data put in those cells from the form. Just leave the cells as is. If you want the calculation to show in your form, you would just basically reverse what you have;


    txBegInvCost.Text = vaData(1, 7).Value
    txPur1Cost.Text = vaData(1, 9).Value


    HTH


    Bruce

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!