Calculated Field in Userform

nasa09

New Member
Joined
Oct 3, 2013
Messages
43
I've got a userform that keeps track of fee waivers, and for each different type of fee there are four textboxes: one textbox each for the amount paid and the amount waived (whose values are pulled from separate worksheets), one textbox to identify the officer who waived the fees, and finally one textbox that is intended to sum the values of the paid and waived textboxes.

I've never worked with calculated fields in userforms, so I'm having trouble. Can somebody help me figure out what I'm doing wrong?




Code:
Dim inputRow As Integer
Dim dataRow As Integer
Dim Due As Double

inputRow = ActiveCell.Row
dataRow = inputRow - 5

txtReconPaid.Value = Format(Sheets("Input").Range("L" & inputRow).Value, "#,##0.00")
txtReconWaived.Value = Format(Sheets("Data").Range("X" & dataRow).Value, "#,##0.00")
txtReconIn.Value = Sheets("Data").Range("Z" & dataRow).Value

Due = txtReconPaid.Value + txtReconWaived.Value
txtReconDue.Value = Format(Sheets("Data").Range("W" & dataRow).Value, "#,##0.00")


Any help is greatly appreciated!!
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

nasa09

New Member
Joined
Oct 3, 2013
Messages
43
Hi Glenn. Sorry, in my haste I obviously forgot to spell out what was causing me grief.

The calculated fields aren't I calulating...I get a type mismatch error. I was able to solve the problem on my own by using variables instead of direct references, but it still leaves me wondering why it wouldn't work the way I originally wrote it.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,564
Messages
5,596,863
Members
414,106
Latest member
Tigretto

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top