Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default How to round of the value with ends zero(0)

Hi there

Not sure exactly what you are wanting to do but this code will round
up the activecel to the nearest 10 as long as it the last digit in the
number is greater than 0.

Option Explicit
Dim Mystr, StrVal As String
Dim i As Integer

Private Sub CommandButton1_Click()
StrVal = Right(ActiveCell, 1)
i = StrVal
If i = 0 Then
Exit Sub
Else
i = 10 - i
ActiveCell.Value = ActiveCell + i
End If

hope this helps you

S

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
round up (ends with...) jatman Excel Worksheet Functions 3 August 30th 08 12:59 PM
filter using "ends with" and 3 choices? Ex: ends with 1,2 or3 Debbie Excel Worksheet Functions 1 April 6th 07 12:07 AM
How to round of the value with ends zero(0) P Vasanth Kumar Excel Programming 2 March 14th 07 03:23 PM
+(-)ve values ends in Dr(Cr) sasikumar Excel Programming 3 June 25th 06 03:30 PM
How do I ROUND() round off decimals of a column dataset? Højrup Excel Worksheet Functions 2 January 12th 05 10:50 AM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"