Thread: [Solved] Reducing numbers by one
View Single Post
 
Old 06-23-2011, 02:42 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
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