VBA userform - decimal separator

agfac

New Member
Joined
Dec 16, 2013
Messages
20
Hi,

I've a VBA userform that finds values in an excel workbook and fill an textbox with that value. I used find and offset to do that. The value is for example "1,4".

On my PC, it fill correctly the textbox with value "1,4" but if I try to run the same VBA userform on another PC it fill the textbox with the value "1.4".

Why is it happenning?

Thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How are you putting the value in the textbox?
 
Upvote 0
How are you putting the value in the textbox?

This is an example:

Code:
If (CB_fcci_potencia_sinal.Value = "Sim" _
    And CB_fcci_potencia_ilum.Value = "Sim" _
    And CB_fcci_potencia_simul.Value = "Sim" _
    And CB_fcci_potencia_det.Value = "Sem SADI" _
    And CB_fcci_potencia_sea.Value = "Não") Then


    Set SearchRange = Worksheets("Potência no CI").Range("E4:E125")
     
    Set lastCell = SearchRange.Cells(SearchRange.Cells.Count)
     
    Set AreaciFound = SearchRange.Find(What:=areaci, After:=lastCell, LookIn:=xlValues, _
    LookAt:=xlWhole, SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, MatchCase:=False, _
    SearchFormat:=False)
    
    If AreaciFound Is Nothing Then
         
        MsgBox areaci & "was not found.", vbInformation, vbNullString
        Exit Sub
         
    End If
     
    If AreaciFound.Offset(, 5) = efetivo Then
        TextBox23.Value = AreaciFound.Offset(, 11).Value
    Else
        FirstAddress = AreaciFound.Address
        Do
            Set AreaciFound = SearchRange.FindNext(AreaciFound)
            If AreaciFound.Offset(, 5) = efetivo Then
                TextBox23.Value = AreaciFound.Offset(, 11).Value
                Exit Do
            End If
        Loop While Not AreaciFound.Address = FirstAddress
    End If


End If
 
Upvote 0
See Mark's suggestion @ VBAExpress.
 
Upvote 0
agfac, try also
Code:
TextBox23.Value = Format(AreaciFound.Offset(, 11).Value)
Artik
 
Upvote 0

Forum statistics

Threads
1,216,462
Messages
6,130,781
Members
449,591
Latest member
sharmavishnu413

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