0
votes

TextBox94.Text = WorksheetFunction.max(TextBox3.Text - TextBox7.Text, TextBox4.Text - TextBox8.Text, TextBox5.Text - TextBox9.Text, TextBox6.Text - TextBox10.Text, TextBox7.Text - TextBox3.Text, TextBox8.Text - TextBox4.Text, TextBox9.Text - TextBox5.Text, TextBox10.Text - TextBox6.Text)

TextBox95.Text = WorksheetFunction.max(TextBox27.Text, TextBox28.Text, TextBox29.Text, TextBox30.Text, TextBox31.Text, TextBox32.Text, TextBox33.Text, TextBox34.Text) - WorksheetFunction.min(TextBox27.Text, TextBox28.Text, TextBox29.Text, TextBox30.Text, TextBox31.Text, TextBox32.Text, TextBox33.Text, TextBox34.Text)

In the first equation it works well, the input(3,7,4,8...) has to be with "," and the output(94) gives me the value also with a comma. In the second one the input has to be mandatory with "." and the output gives me the value with ",". I need to put the values in the input with comma instead of point. What can I do?

1
Hi Artur, thanks for your post ! Could you make that quesiton easier to understand ? Maybe avoid a copy paste and translate in a way we can undertand what you need :) Let me know ! - Puygrenier S.
0 imgur.com/Shy3HLV This uses the code "TextBox94.Text" The TextBox95.Text only accepts values with points, like 2.1 or 2.2. I want it to accept 2,1 and 2,2 - Artur Castro

1 Answers

0
votes

From my point of view there at least two possibilities :

1- Convert the "." to "," every time a text box when a event occur or here, when a text box is changed

 '=== adapted from https://www.mrexcel.com/board/threads/excel-vba-decimal-seperator-comma-or-point.109941/ ===
Private Sub TextBox1_Change(){
  TextBox1.Text= WorksheetFunction.Substitute(TextBox1.Text, ",", ".")
}

2- Try to change some settings (not sure at 100% for this one). You can change your separator from dot to coma. Have a look on the link bellow about how to proceed. https://www.howtogeek.com/245510/how-to-change-excels-decimal-separators-from-periods-to-commas/ Be careful, even if it's working it will be on your setting only, others users can have trouble using you form.

Take care !