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!!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
What are you having trouble with exactly?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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
Back
Top