![]() |
|
|
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
||||
|
||||
|
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] |
|
#3
|
|||
|
|||
|
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
|
|
#4
|
|||
|
|||
|
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?!
|
|
#5
|
||||
|
||||
|
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] |
|
#6
|
||||
|
||||
|
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] |
|
|
|
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 |