Hello, Dears,
Our decimal number separator is comma. I have a problem with decimal problems in the userform. I can get decimal data in the textbox, but It doesn't perform multiplication with the decimal data. For example real data is 0,41 however excel see it like 41. The codes are below, I kindly ask some help.
Private Sub ComboBox1_Change()
Dim tablo1 As Range
Dim A As Integer
Dim B As Double
Set tablo1 = Worksheets("sayfa1").Range("A2:A22")
A = ComboBox1.Value
B = Application.WorksheetFunction.VLookup(A, tablo1.Resize(, 2), 2, False)
TextBox1.Value = B
B = CDbl(TextBox1.Value)
End Sub
Private Sub CommandButton1_Click()
Dim adet As Integer
Dim B As Double, Boy As Double, toplam As Double
B = CDbl(TextBox1.Value)
adet = CInt(ComboBox2.Value)
Boy = CDbl(TextBox2.Value)
toplam = B * adet * Boy
TextBox3.Value = toplam
End Sub
Our decimal number separator is comma. I have a problem with decimal problems in the userform. I can get decimal data in the textbox, but It doesn't perform multiplication with the decimal data. For example real data is 0,41 however excel see it like 41. The codes are below, I kindly ask some help.
Private Sub ComboBox1_Change()
Dim tablo1 As Range
Dim A As Integer
Dim B As Double
Set tablo1 = Worksheets("sayfa1").Range("A2:A22")
A = ComboBox1.Value
B = Application.WorksheetFunction.VLookup(A, tablo1.Resize(, 2), 2, False)
TextBox1.Value = B
B = CDbl(TextBox1.Value)
End Sub
Private Sub CommandButton1_Click()
Dim adet As Integer
Dim B As Double, Boy As Double, toplam As Double
B = CDbl(TextBox1.Value)
adet = CInt(ComboBox2.Value)
Boy = CDbl(TextBox2.Value)
toplam = B * adet * Boy
TextBox3.Value = toplam
End Sub