Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 from Each Number in Column
I have a column of quantities in excel and I want to subtract 1 fro
each of these numbers, unless the number is already zero. Any idea ho to do that? Thanks -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 from Each Number in Column
Hi
and what should happen to values like 0.5? -- Regards Frank Kabel Frankfurt, Germany I have a column of quantities in excel and I want to subtract 1 from each of these numbers, unless the number is already zero. Any idea how to do that? Thanks! --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 from Each Number in Column
for each cell in selection
if isnumeric(cell.Value) then if cell.Value 1 then if not cell.Hasformula then cell.Value = cell.Value - 1 end if end if End if Next or set rng = Selection.SpecialCells(xlConstants,xlNumbers) for cell in rng if cell.Value 0 then cell.Value = Cell.Value - 1 end if Next -- Regards, Tom Ogilvy "ani " wrote in message ... I have a column of quantities in excel and I want to subtract 1 from each of these numbers, unless the number is already zero. Any idea how to do that? Thanks! --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 from Each Number in Column
Sounds like an inventory program.
-- Regards, Tom Ogilvy "Frank Kabel" wrote in message ... Hi and what should happen to values like 0.5? -- Regards Frank Kabel Frankfurt, Germany I have a column of quantities in excel and I want to subtract 1 from each of these numbers, unless the number is already zero. Any idea how to do that? Thanks! --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 from Each Number in Column
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I subtract a negative number from a positive number? | Excel Discussion (Misc queries) | |||
subtract column right from column left in excel? | New Users to Excel | |||
subtract 10 from every number in a column | Excel Worksheet Functions | |||
how to subtract the very next LOWEST number | New Users to Excel | |||
How can I subtract 111 from a number like 097 and get 987, using . | Excel Worksheet Functions |