text to number macro and unsolvable problem

%3CLINGO-SUB%20id%3D%22lingo-sub-2164068%22%20slang%3D%22en-US%22%3Etext%20to%20number%20macro%20and%20unsolvable%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164068%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everybody%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eplease%20have%20a%20look%20on%20my%20file%2C%20i'm%20trying%20to%20convert%20some%20data%20and%20i'm%20facing%20few%20inexplicable%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20allready%20try%20many%20solution%20but%20it%20is%20not%20working%20as%20i%20want.%3C%2FP%3E%3CP%3Ein%20the%20best%20before%20and%20after%20you%20will%20see%20the%20data.%20many%20of%20them%20are%20well%20converted%20with%20different%20solution%20that%20i%20tried%20in%20my%20macro%20but%20some%20cell%20it%20doesn't%20work%20automatically.%20i%20have%20tried%20column%20to%20text%2C%20paste%20special%2C%20substitute%20but%20nothing%20working%20well.%3C%2FP%3E%3CP%3Eis%20somebody%20could%20explain%20me%20what's%20is%20happening%3F%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F156456%22%20target%3D%22_blank%22%3E%40Faraz%20Shaikh%3C%2FA%3E%26nbsp%3B%3F%3F%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2164068%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2172457%22%20slang%3D%22en-US%22%3ERe%3A%20text%20to%20number%20macro%20and%20unsolvable%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2172457%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F977868%22%20target%3D%22_blank%22%3E%40debou7001%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20far%20as%20I%20understand%20looking%20at%20the%20file%2C%20you%20are%20trying%20to%20convert%20the%20decimal%20value%20for%20%22%2C%22%20into%20a%20%22.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20convert%20the%20same%20following%3C%2FP%3E%3CP%3E1.%20Power%20Query%20changing%20the%20data%20type%3C%2FP%3E%3CP%3E2.%20Writing%20the%20formula%20in%20the%20cell%20as%20showed%20in%20each%20screenshot%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222021-02-28_18-31-33.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258755i79253A47CC131112%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222021-02-28_18-31-33.png%22%20alt%3D%222021-02-28_18-31-33.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20attaching%20the%20file%20you%20can%20have%20a%20look%3C%2FP%3E%3CP%3EHope%20this%20is%20workable%20for%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERegards%2C%20Faraz%20Shaikh%20%7C%20MCT%2C%20MIE%2C%20MOS%20Master%2C%20Excel%20Expert%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CFONT%20color%3D%22%23808080%22%3EIf%20you%20find%20the%20above%20solution%20resolved%20your%20query%20don't%20forget%20mark%20as%26nbsp%3B%3CSPAN%3EOfficial%2FBest%20Answer%20%26amp%3B%20like%20it%20to%20help%20the%20other%20members%20find%20it%20more.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi everybody,

 

please have a look on my file, i'm trying to convert some data and i'm facing few inexplicable problem.

 

I have allready try many solution but it is not working as i want.

in the best before and after you will see the data. many of them are well converted with different solution that i tried in my macro but some cell it doesn't work automatically. i have tried column to text, paste special, substitute but nothing working well.

is somebody could explain me what's is happening?

thanks

@Faraz Shaikh ??

3 Replies

Hi @debou7001,

 

As far as I understand looking at the file, you are trying to convert the decimal value for "," into a "."

 

You can convert the same following

1. Power Query changing the data type

2. Writing the formula in the cell as showed in each screenshot

 

2021-02-28_18-31-33.png

 

I'm attaching the file you can have a look

Hope this is workable for you.

 

Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert

If you find the above solution resolved your query don't forget mark as Official/Best Answer & like it to help the other members find it more.

Thanks Faraz,

Unfortunatly it seems that it is more complicated. When i open my original file i see all value as text. I try to find a solution to convert them as number or as date. But there is some crazy things. Some Column are well converted ( At that time i use texttocolumn in a loop to convert them) but in some column sometime some value are not well converted in number or they keep the . as the decimal separator at least the coma. than 1.500 is not 1,500. i'm trying to find a way to fix that.I want to force to use regional setting but i dont understand why it is not working too.
best regards. and again thanks for your previous reply.

@debou7001 

With Text to Columns you shall select proper separators on the third step of the wizard. As they are in source data, not in your locale.

image.png