Reply
 
Thread Tools Display Modes
  #1   Report Post  
William Bub
 
Posts: n/a
Default How do I reference cells in a Word table?

In a large Word table, is it possible (staying in Word and not using Excel)
to, for example, have column A contain a number, and coulmn B contain that
number plus 4, for a large number of rows? I would like to do this without
having to enter a different formula in each of the column B cells. Is there
any way to use relative cell addressing? A macro to enter the formulas,
perhaps?
  #2   Report Post  
Greg Maxey
 
Posts: n/a
Default

William,

A VBA maestro would probably call this crude, but you might try the
following:

Sub ScratchMacro()
Dim i As Long
Dim aValue As Range
Dim bValue As Range
Dim oTbl As Table
Set oTbl = Selection.Tables(1)
For i = 1 To oTbl.Rows.Count
Set aValue = oTbl.Cell(i, 1).Range
If IsNumeric(aValue) Then
With aValue
.MoveEnd Unit:=wdCharacter, Count:=-1
End With
Set bValue = oTbl.Cell(i, 2).Range
bValue = aValue + 4
End If
Next

End Sub


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

William Bub wrote:
In a large Word table, is it possible (staying in Word and not using
Excel) to, for example, have column A contain a number, and coulmn B
contain that number plus 4, for a large number of rows? I would like
to do this without having to enter a different formula in each of the
column B cells. Is there any way to use relative cell addressing? A
macro to enter the formulas, perhaps?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
word xp crashes after macros are recorded kharris0405 Microsoft Word Help 3 January 11th 05 11:50 PM
WP Delay Code - Word Equiv Mike G - Milw, WI Microsoft Word Help 6 January 10th 05 05:12 PM
Excel worksheet in Word linked text boxes Eduardo Oliveira Page Layout 0 January 6th 05 12:23 AM
Text space in table cells in Word 2003 (using Windows XP) Jaykay Tables 1 December 2nd 04 12:16 PM
how can I use autosum in a WORD table with blank cells Jennifer from DPI Tables 4 November 11th 04 08:30 AM


All times are GMT +1. The time now is 09:13 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"