Hi, I have an Excel table converted from PDF. It contains text and range of number. When I use the 1st procedure, if I understand correctly, it should select cell with constant to include in the result? Somehow I still include the text part? Using the 2nd code is okay but It took long time to edit the table.
Sub DividedbyThousand()
Dim ConstantCells As Range
Dim cell As Range
Set ConstantCells = Selection.SpecialCells(xlCellTypeConstants)
For Each cell In ConstantCells
If cell.Value > -100 Then
cell.Value = cell.Value / 1000
End If
Next cell
For Each cell In ConstantCells
If cell.Value < -100 Then
cell.Value = cell.Value / 1000
End If
Next cell
End Sub
Sub DividedbyThousandv2()
Dim cell As Range
For Each cell In Selection
If cell.Value > 100 Then
cell.Value = cell.Value / 1000
ElseIf cell.Value < -100 Then
cell.Value = cell.Value / 1000
End If
Next cell
End Sub
Sub DividedbyThousand()
Dim ConstantCells As Range
Dim cell As Range
Set ConstantCells = Selection.SpecialCells(xlCellTypeConstants)
For Each cell In ConstantCells
If cell.Value > -100 Then
cell.Value = cell.Value / 1000
End If
Next cell
For Each cell In ConstantCells
If cell.Value < -100 Then
cell.Value = cell.Value / 1000
End If
Next cell
End Sub
Sub DividedbyThousandv2()
Dim cell As Range
For Each cell In Selection
If cell.Value > 100 Then
cell.Value = cell.Value / 1000
ElseIf cell.Value < -100 Then
cell.Value = cell.Value / 1000
End If
Next cell
End Sub