View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Rounding numbers with CEILING function



For Each cell In Range("O2:Q" & lastrow)
cell.Value = Application.Ceiling(cell, 1)
Next

"matpj" wrote:


Hi all,

I have 3 colulmns of data column O,P,Q in my worksheet.
I need my macro to reound all of these figures up to the nearest whole
number e.g. CEILING(O2,1)

Is it possible to do this in the same column - i.e. without inserting a
column and applying a formula to get the ceiling, and then
copying/pasting values before removing the oringal column?

I just want to be able to perform the calculation on the three columns
of data using the range governed by the last row.

I have set a variable to the last row, so the range of data is
"O2:Q<lastrow"


any ideas?

thank in advance,
matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=525344