I am trying to divide all the cells in a selection by 1000 but not cells which have a sum formula.
Criteria:
- Cell must have a number.
- Cell should not contain the
Sum()
formula (any other formula is okay).
If both of these criteria are met then divide the cell value by 1000.
For Each cell In Selection.Cells
If IsNumeric(cell) = False Or cell.Address = Left(ActiveCell.Formula, 5) = "=Sum(" Or cell.Address = Left(ActiveCell.Formula, 6) = "=+SUM(" Or cell.Address = Left(ActiveCell.Formula, 6) = "=-SUM(" Then
MsgBox ("Selection either does contain numbers or has only sum formulae")
Else
cell.value = cell.value / 1000
End If
Next