Hi,
I'm using the following code.
When I look at the generated file I see that the cell is left aligned and there is an exclamation saying that the number has been saved as text.Cells(1,1).Value = Format(Round(nTotal, 2), "#,##0.00")
This is obviously not what I want.
I checked the format function and it seems to return a string.
Is there a way to make sure it returns a number.
Thanks
Last edited by gosa; 12-06-2011 at 09:22 AM.
Change the cell format instead:
I assume you are aware that the VBA Round function does not work the same way as the worksheet version. (it uses Bankers Rounding)With Cells(1,1) .Numberformat = "#,##0.00" .Value = Round(nTotal, 2) End With
Yes - that will give you 'normal' rounding.![]()
Great!
I really wouldn't have known if you didn't mention it.
Thanks again!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks