First of all, for 251, the NEAREST multiple of 10 is 250, not 260.
You're wishing to round UP to the NEXT multiple of 10!

Also, you said that the "fraction should not be considered"
That would imply that:
251.0 would round to 260
but:
250.99999999 would round to 250

if that's what you're looking for, then this should do the trick:

'    tNum is your value

    RndNo = Int(Int(tNum) / 10) * 10
    If (RndNo <> Int(tNum)) Then
        RndNo = RndNo + 10
    End If
 
Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------




________________________________
From: Shankar Bheema <shankar.n...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Thu, January 5, 2012 6:08:51 AM
Subject: $$Excel-Macros$$ rounding off to nearest multiple of 10

Dear experts

I am using excel vba.  I want to round off an amount to its nearest multiple of 
10.

eg :  251.10  (here fraction should not be considered only the whole number 
which has to be rounded off to its nearest multiple of 10 i.e. 260)

252 = 260
but 250 remains 250

Pls do reply
-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

 
NOTE : Don't ever post personal or confidential data in a workbook. Forum 
owners 
and members are not responsible for any loss.
 
------------------------------------------------------------------------------------------------------

To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to