Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2011, 05:47 AM
colliedug colliedug is offline Reducing numbers by one Windows XP Reducing numbers by one Office 2007
Novice
Reducing numbers by one
 
Join Date: Jun 2011
Posts: 4
colliedug is on a distinguished road
Default Reducing numbers by one

Help please. I have a table with lots of numbers in one column. I want to reduce each number by one - I have searched to find out how to do this and I am none the wiser - there surely must be a simple way to do this without having to alter each cell in the column manually?
Reply With Quote
  #2  
Old 06-23-2011, 02:42 AM
macropod's Avatar
macropod macropod is offline Reducing numbers by one Windows 7 64bit Reducing numbers by one Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi colliedug,

Here's a macro to do the work. Simply select the column then run it.
Code:
Sub SubtractOne()
Application.ScreenUpdating = False
Dim i As Long, Rng As Range
With Selection
  If .Information(wdWithInTable) Then
    For i = 1 To .Rows.Count
      With .Columns(1).Cells(i)
        Set Rng = .Range
        With Rng
          .End = .End - 1
          If IsNumeric(.Text) Then .Text = .Text - 1
        End With
      End With
    Next
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-23-2011, 03:04 AM
colliedug colliedug is offline Reducing numbers by one Windows XP Reducing numbers by one Office 2007
Novice
Reducing numbers by one
 
Join Date: Jun 2011
Posts: 4
colliedug is on a distinguished road
Default

Thank you so much Paul. I'm a bit puzzled as to why such a simple operation is not catered for already without having to resort to a macro.

Anyway your macro did the trick - thanks again.

Saved me a LOT of retyping
Reply With Quote
  #4  
Old 06-23-2011, 03:57 AM
colliedug colliedug is offline Reducing numbers by one Windows XP Reducing numbers by one Office 2007
Novice
Reducing numbers by one
 
Join Date: Jun 2011
Posts: 4
colliedug is on a distinguished road
Default

One other question Paul - do you mark the post as solved or do I?

If it's me then I can't see how to do it?!
Reply With Quote
  #5  
Old 06-23-2011, 05:49 AM
macropod's Avatar
macropod macropod is offline Reducing numbers by one Windows 7 64bit Reducing numbers by one Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi colliedug,

Word tables don't have the same tools as, say, Excel - where this could be done more easily.

Marking a thread as solved is done via the 'Thread Tools' dropdown at the top of the thread (done).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 06-23-2011, 05:49 AM
macropod's Avatar
macropod macropod is offline Reducing numbers by one Windows 7 64bit Reducing numbers by one Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi colliedug,

Word tables don't have the same tools as, say, Excel - where this could be done more easily.

Marking a thread as solved is done via the 'Thread Tools' dropdown at the top of the thread (done).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with reducing pptm file size vbapptnew123 PowerPoint 1 06-11-2011 06:24 PM
Numbers in Words janak Excel 2 12-19-2010 08:53 PM
Increment Numbers Help Jazz43 Word 2 07-30-2010 02:48 AM
page numbers and TOC windon Word 0 09-09-2009 07:53 AM
Equation Numbers BillG Word 0 08-04-2009 08:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:51 AM.


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