Issues with Capcost (Mismatch Type, Run-time Error '13')

anonymity

New Member
Joined
Jan 28, 2024
Messages
7
Office Version
  1. 365
  2. 2016
Hi guys, im a chemical engineering student, currently doing a senior work project for my final year, so i decided to use the capcost excel by turton, obtained from the book of Analysis Synthesis and Design of Chemical Processes 5th Edition. However, when trying to input data for 'fan' unit, it gives me the Run-time error '13' , mismatch type. The code highlighted this line in the debuggin section:
1706432362754.png


grateful for any help, thank you in advance :))
 
Can you show us where the tbBaseCost is being calculated and formatted.
The way it looks to me is that there is a space after the comma in the immediate window but not in your form, which seems odd.

1706533660741.png


I can't tell what time zone you are in, so in case it gives you any ideas the below works for me in terms of having the form value treated as a number.
VBA Code:
Sub test_conversion()

    Dim sVal As String
    Dim dVal As Double
    
    sVal = "$ 31, 721"
    dVal = CDbl(Replace(sVal, " ", ""))
    
    Debug.Print "dVal ", dVal
    Debug.Print "Multiply by 10 ", dVal * 10
    
End Sub
 
Upvote 0
Solution

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
sorry for not replying, the problem is solved now 🥹, thanks for helping me,
the issue is mainly due to the compatibility of the excel origin region with my region, the origin was set in US, im residing in Malaysia, so i just actually need to set my current region to the US, and badaboom it works, thanks alot tho.
 
Upvote 0
sorry for not replying, the problem is solved now 🥹, thanks for helping me,
the issue is mainly due to the compatibility of the excel origin region with my region, the origin was set in US, im residing in Malaysia, so i just actually need to set my current region to the US, and badaboom it works, thanks alot tho.
hi, can you help me to solve the same problem. also from malaysia. tq in advance
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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