Data1| data2|
12.22| 12.22|
12.22| 12.22|
12.22| 12.22|
12.22| 12.22|
I want to remain the two decimal point, but not round the number.
so the data will be like this,
Data1| data2|
1222| 1222|
1222| 1222|
1222| 1222|
1222| 1222|
so as I read at the tutorial, and my code do like this,
- Code: Select all
Dim workbook As Workbook = New Workbook
workbook.Version = ExcelVersion.Version2007
workbook.LoadFromFile(("4.xlsx"))
Dim sheet As Worksheet = workbook.Worksheets(1)
Dim range = sheet.Columns(23)
'For r As Integer = 2 To sheet.AllocatedRange.Rows.Count()
For i As Integer = 1 To range.LastRow - 1
If range.Cells(i).Text IsNot Nothing Then
Exit For
End If
If range.Cells(i).NumberFormat = "#,##0.00" Then
'range.Cells(i).NumberFormat = "0"
sheet.Columns(23).NumberFormat = "0"
End If
Next
but this code are rounded my data. I want it to maintain the after decimal point. thanks all. really sorry