VBA Macro wont work in Norway

pjmsimmons

Board Regular
Joined
Dec 13, 2011
Messages
80
Hi All,
I have a piece of code which is working fine on my PC in Ireland (which uses English as regional settings). The code was also working fine when I sent it to colleagues in Norway.

The code took the worksheet 'Sample Info & Results' and converted it to a CSV file using getsaveasfilename.

However, I have now added the following code to the worksheet to round the data within the given range to 3 decimal places prior to exporting to the CSV file. This has created a problem in Norway as each cell within the range gives a '#Value!' error instead of displaying the value for each cell when the code has run. The code works perfectly for me in Ireland but my colleagues in Norway get the error. Removing the code gets the macro working again in Norway but obviously without the required rounding. I think it must be a localisation problem but has anyone any experience with this?

Any help much appreciated. The code is:

Code:
For Each Cell In [e10:f102]
        Cell.Value = Evaluate("round(" & Cell & ",3)")
    Next Cell
Regards,

Paul
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Thanks Andrew. I will give it a go. For my own information, what would be the difference in technique between the two codes?

regards,

Paul
 
Upvote 0

Forum statistics

Threads
1,223,061
Messages
6,169,875
Members
452,288
Latest member
neplecha

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