I have a company/product cost file and need to carry specific data from that file over to a monthly customer file that lists all the products the customer purchases in a given month. One of the fields is the cost of the product. In the cost file, that field is formatted as 'Number'. There are many records in that file where the cost will extend up to 4 decimal places (e.g., 1.5364) and it is imperative that these values by accurately written to the monthly customer file.
One of the records in the cost file shows a cost of 5.677. The problem I am having is that when that particular value is written in the monthly customer file I get 5.67. There are several records in the monthly customer file that is a match and every one of them is showing up with 5.67. I did change the number of decimal places to 4 so it is not simply an issue of not showing all #s via a formatting issue. Besides if that was the issue it would be showing up as 5.68.
This is the line of code I am using to write the Value from one file to another:
I have been researching online and I tried using Value2 but still get the same result.
I tried to first change the format of the Column to Currency but still get the same result.
Any and all help would be much appreciated!
Thanks,
Frank
One of the records in the cost file shows a cost of 5.677. The problem I am having is that when that particular value is written in the monthly customer file I get 5.67. There are several records in the monthly customer file that is a match and every one of them is showing up with 5.67. I did change the number of decimal places to 4 so it is not simply an issue of not showing all #s via a formatting issue. Besides if that was the issue it would be showing up as 5.68.
This is the line of code I am using to write the Value from one file to another:
VBA Code:
custWS.Cells(i, "L").Value = ccWS.Cells(x, "K").Value
I have been researching online and I tried using Value2 but still get the same result.
I tried to first change the format of the Column to Currency but still get the same result.
Any and all help would be much appreciated!
Thanks,
Frank