Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2012, 08:49 PM
ubns ubns is offline Round off the number Windows 7 32bit Round off the number Office 2010 32bit
Competent Performer
Round off the number
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default Round off the number

Hi,



If we have table of figures in word lets say - 100 items with the unit price.

If we want to round off the number on maths principle i.e. if more than .5 it increase the number round off for example 12.6 will 13. and if less than .5 it will assume its lower value i.e. 12.4 to 12.

I want this on selected table only. Is there a way we can do this.

Regards

Umesh Banga
Reply With Quote
  #2  
Old 09-04-2012, 08:27 PM
macropod's Avatar
macropod macropod is offline Round off the number Windows 7 64bit Round off the number Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

All cells, cells in a particular column/row?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-04-2012, 08:56 PM
ubns ubns is offline Round off the number Windows 7 32bit Round off the number Office 2010 32bit
Competent Performer
Round off the number
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default

all cells in the selected table.
Reply With Quote
  #4  
Old 09-04-2012, 09:59 PM
macropod's Avatar
macropod macropod is offline Round off the number Windows 7 64bit Round off the number Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, you could use code like:
Code:
Sub FormatNumbers()
Dim Rng As Range, Tbl As Table, oCll As Cell, StrFmt As String
With Selection
  If .Information(wdWithInTable) = True Then
    For Each oCll In .Tables(1).Range.Cells
      Set Rng = oCll.Range
      Rng.End = Rng.End - 1
      If IsNumeric(Rng.Text) Then
        If Left(Rng.Text, 1) Like "[$€ге]" Then
          StrFmt = Left(Rng.Text, 1)
        Else
          StrFmt = ""
        End If
        If InStr(Rng.Text, ",") > 0 Then
          Rng.Text = StrFmt & Format(Round(Rng.Text, 0), "#,###")
        Else
          Rng.Text = StrFmt & Round(Rng.Text, 0)
        End If
      End If
    Next
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 09-06-2012, 03:55 PM
ubns ubns is offline Round off the number Windows 7 32bit Round off the number Office 2010 32bit
Competent Performer
Round off the number
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default

Thanks Paul.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Round off the number Round Blue Circle Keeps Flashing and Circling randyflycaster Word 5 09-14-2011 07:29 AM
Round off the number Mailing: how to make the "page number" in Word is the same as "row number" in excel w Jamal NUMAN Word 1 09-03-2011 11:37 AM
Round off the number histograms have me running round like headless chook agorgainc Excel 2 05-12-2011 04:29 AM
how can i make round border edges bobafet Word 4 11-19-2009 04:40 PM
round border egde problem(is there a better option) bobafet Word 0 11-17-2009 11:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft