Thread
:
Newbie Question on on tables
View Single Post
#
6
Posted to microsoft.public.word.tables
[email protected]
external usenet poster
Posts: 6
Newbie Question on on tables
On Tue, 05 Dec 2006 09:50:48 +0000,
wrote:
On Tue, 5 Dec 2006 05:45:35 +0100, "Doug Robbins - Word MVP"
wrote:
See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?"
http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm
Thanks, I'll have a look.
B.N.
Following the advice given in the URL above I arrive with the
following:-
Sub Macro1()
'
' Macro1 Macro
' Macro created 05/12/2006 by Bill Nelson
'
End Sub
Again following the advice as above , I deleted the two lines between
"Sub Macro1() " & "End Sub" into which I then pasted your code given
in your post after removing all the "" symbols which preceeded each
line.
I thus arrived at the following :-
Sub Macro1()
Dim i As Long, j As Long, k As Long
Dim atable As Table
Set atable = Selection.Tables(1)
k = 1
For i = 1 To 123 Step 3
For j = 1 To 3
atable.Cell(i + j - 1, 1).Range.InsertBefore k & Chr(64 + j)
Next j
k = k + 1
Next i
k = 42
For i = 124 To 201 Step 6
For j = 1 To 6
atable.Cell(i + j - 1, 1).Range.InsertBefore k & Chr(64 + j)
Next j
k = k + 1
Next i
End Sub
When I now attempt to run this -( by clicking F5 - is this correct ? )
- I get the error :-
"Run-time error '5941' the requested member of the collection does not
exist "
If I now click "DEBUG" I get the line "Set atable = Selection Tables
(1) " highlighted in yellow.
I'm afraid I don't understand any of this !
B.N.
Reply With Quote
[email protected]
View Public Profile
Find all posts by
[email protected]