VBA run-time error 13: type mismatch

Anonymous
2022-03-07T20:33:36+00:00

Hello,

I've created a UserForm in Excel to calculate a value from an input. I've written out the code and I can't figure out why it's a type mismatch. Please help! I'm new at VBA and I've written this out by just following YouTube tutorials. The end goal of this UserForm is to take the input in Total Real Meters and perform the calculations in the code below to give me an output in the Total Allocated box. I'm sure my code isn't complete. I'm just trying to get over this one hurdle first. I'd love any direction or explanations you can provide me. Thank you in advance!

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. HansV 462.4K Reputation points MVP Volunteer Moderator
    2022-03-07T21:24:36+00:00

    Simply delete the line highlighted in yellow. It is not needed, since the lines after it calculate totalAllocated.

    Just above End Sub, enter

    TextBox2 = totalAllocated
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2022-03-07T22:04:20+00:00

    Thank you! That did it!

    0 comments No comments