Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.
Become a Premium Member and unlock a new, free course in leading technologies each month.
For Each cell In rgsearch
If IsError(cell.Value) Then
xlws.Range(pbcol & cell.Row & ":" & pecol & cell.Row).ClearContents
End If
If Not IsNumeric(cell.Value) Or (cell.Value = "") Then
'Debug.Print cell.Row
xlws.Range(pbcol & cell.Row & ":" & pecol & cell.Row).ClearContents
End If
If (cell.Value > 0) And (cell.Value <= 0.001) Then
cell.Value = 0.002
End If
If (cell.Value > 100) And (cell.Value <= 100.001) Then
cell.Value = 100.002
End If
If (cell.Value < 0) And (cell.Value >= -0.001) Then
cell.Value = -0.002
End If
If (cell.Value > 99.998) And (cell.Value <= 99.999) Then
cell.Value = 99.998
End If
Next cell
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Dim s as string
s = Right(FormatNumber(cell.Value, 3), 3)
If s = "999" then Cell.Value = "" & Left(cell.Value, instr(1, Cell.Value, ".") & "998"
if s = "001" then Cell.Value = "" & Left(cell.Value, instr(1, Cell.Value, ".") & "002"
dim x as double
' round the cell value to three decimal places
x = round(cell.Value, 3)
' x - int(x) gives you the decimal portion
select case (x - int(x))
' If the decimal portion is .999 update the cell to the int part + .998 decimal
Case .999
cell.Value = int(x) + .998
' If the decimal portion is .001 update the cell to the int part + .002 decimal
Case .001
cell.Value = int(x) + .002
' If it is neither, do nothing. Select case block gives you room for more options
Case Else
' do nothing
End Select
dim x as double
' round the cell value to three decimal places
x = round(cell.Value, 3)
' x - int(x) gives you the decimal portion --- *** we need to round this result too.
select case Round((x - int(x)), 3)
' If the decimal portion is .999 update the cell to the int part + .998 decimal
Case .999
cell.Value = int(x) + .998
' If the decimal portion is .001 update the cell to the int part + .002 decimal
Case .001
cell.Value = int(x) + .002
' If it is neither, do nothing. Select case block gives you room for more options
Case Else
' do nothing
End Select
dim x as double
' set x to hold the cell value
x = cell.Value
' x - int(x) gives you the decimal portion --- *** we need to round this to 3 decimal places
select case Round((x - int(x)), 3)
' If the decimal portion is .999 update the cell to the int part + .998 decimal
Case .999
cell.Value = int(x) + .998
' If the decimal portion is .001 update the cell to the int part + .002 decimal
Case .001
cell.Value = int(x) + .002
' If it is neither, do nothing. Select case block gives you room for more options
Case Else
' do nothing
End Select
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.