Problemes with Excel VBA/Macro

%3CLINGO-SUB%20id%3D%22lingo-sub-1466974%22%20slang%3D%22en-US%22%3EProblemes%20with%20Excel%20VBA%2FMacro%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1466974%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20in%20an%20application%20with%20Userforms.%3C%2FP%3E%3CP%3EThe%20application%20must%20run%20in%20different%20computers.%20It%20means%20it%20can%20be%20%22Spanish%22%20Excel%2C%20%22English%22%20Excel%2C%20etx.%20and%20in%20any%20case%20decimal%20character%20can%20be%20%22.%22%20or%20%22%2C%22.%3C%2FP%3E%3CP%3EI%20have%20included%20in%20the%20application%20a%20definition%20valid%20for%20the%20decimal%20character.%3C%2FP%3E%3CP%3EHowever%2C%20if%20I%20run%20the%20%22Spanis%22%20Excel%20and%20decimal%20character%20is%20%22.%22%20it%20doesn't%20work%20properly.%3C%2FP%3E%3CP%3EIn%20order%20to%20capture%20data%20from%20an%20excel%20file%2C%20let's%20say%2C%205.25%3B%20the%20instruction%3C%2FP%3E%3CP%3EA%20%3D%20Cell(%22A1%22).Value%20captures%205%2C25%3C%2FP%3E%3CP%3EIn%20order%20to%20capture%205.25%20I%20must%20say%3C%2FP%3E%3CP%3EA%20%3D%20Cell(%22A1%22).Text%3C%2FP%3E%3CP%3EAnd%20once%20I%20have%20captures%20the%20calue%2C%20if%20I%20want%20to%20operate%20with%20A%2C%20if%20I%20write%3C%2FP%3E%3CP%3EB%20%3D%20Dbl(A)%2C%20instead%20of%20having%205%2C25%20what%20I%20obtain%20is%20525%20(without%20comma).%3C%2FP%3E%3CP%3EAny%20solution%20for%20this%20problem%3F%3C%2FP%3E%3CP%3EI%20need%20to%20pass%20the%20values%20to%20a%20userform%20and%20I%20read%20the%20values%20from%20the%20userform.%20For%20this%20reson%20I%20must%20%22show%22%20thae%20values%20with%20%22.%22.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am working in an application with Userforms.

The application must run in different computers. It means it can be "Spanish" Excel, "English" Excel, etx. and in any case decimal character can be "." or ",".

I have included in the application a definition valid for the decimal character.

However, if I run the "Spanis" Excel and decimal character is "." it doesn't work properly.

In order to capture data from an excel file, let's say, 5.25; the instruction

A = Cell("A1").Value captures 5,25

In order to capture 5.25 I must say

A = Cell("A1").Text

And once I have captures the calue, if I want to operate with A, if I write

B = Dbl(A), instead of having 5,25 what I obtain is 525 (without comma).

Any solution for this problem?

I need to pass the values to a userform and I read the values from the userform. For this reson I must "show" thae values with ".".   

0 Replies