Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Macros. Excel operates with 15 digits. I need 18 digits

Hello

I have data with 18 digits in it.

When running a macro it converts to a number and as Excel operates with 15 digits any digits beyond will be changed to 0.

Screenshot_1.jpg

For a workaround, I use chr(39) to convert it into text but that's not what I expect. Because now when the user enters ERP and copies the cell it has to remove the quite mark.

Could you help me out?

 

Labels (2)
1 Solution

Accepted Solutions
marcus_sommer

You may add any formatting which is different to the used region-setting and/or unknown for Excel to prevent this auto-converting. But I assume it won't change much else just replacing chr(39) with another char(s) which also leads to problems ... whereby there might be chars which prevent the auto-converting and which are simply ignored/removed by copying/importing into your target-tool, for example it might any of the white-spaces.

Another way could be not to export to Excel else into a csv which is then directly opened with Excel (AFAIK here happens also some auto-converting) or it's used as an external data source.

Alternatives may be not to export the data else to copy them (creating a new file or opening an existing one, formatting the area as text and to copy then the content) or to write them (looping through each cell of your QV object and writing it into Excel.

- Marcus

View solution in original post

1 Reply
marcus_sommer

You may add any formatting which is different to the used region-setting and/or unknown for Excel to prevent this auto-converting. But I assume it won't change much else just replacing chr(39) with another char(s) which also leads to problems ... whereby there might be chars which prevent the auto-converting and which are simply ignored/removed by copying/importing into your target-tool, for example it might any of the white-spaces.

Another way could be not to export to Excel else into a csv which is then directly opened with Excel (AFAIK here happens also some auto-converting) or it's used as an external data source.

Alternatives may be not to export the data else to copy them (creating a new file or opening an existing one, formatting the area as text and to copy then the content) or to write them (looping through each cell of your QV object and writing it into Excel.

- Marcus