lesa
asked on
Excel formatting
I am using excel as Object in VB 5.0. I am getting the values of the cell in excel as
Value = xlSheet.Cells(1, 1). But the problem is if the excel cell is having 123.450
as the value it is returning 123.45 instead of 123.450. I want to get 123.450 from the excel and as well I want the excel to save the file with 123.450 instead of 123.45 as it normally does.
Can anybody help me out in this issue.
Value = xlSheet.Cells(1, 1). But the problem is if the excel cell is having 123.450
as the value it is returning 123.45 instead of 123.450. I want to get 123.450 from the excel and as well I want the excel to save the file with 123.450 instead of 123.45 as it normally does.
Can anybody help me out in this issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have no fixed decimals to make use of the above format. What all I want is if the user enters 123.450 it should save like that instead of 123.45. The decimals may vary like 123.4560 then it should save as 123.4560 instead of 123.456.
looks like you want floating zeros. Why would you like a zero on the end if there are no values in that column? You could use the 'lostfocus' event to set the value:
text1.text = text1.text & "0"
That way you will always append a zerol
text1.text = text1.text & "0"
That way you will always append a zerol
David