Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
[email protected] admiral_victory@iol.ie is offline
external usenet poster
 
Posts: 6
Default Newbie Question on on tables

I would like to print out a table which has the sequence in descending
alphabetical order in the first column as follows:-

1A
1B
1C

2A
2B
2C

3A
...etc until

41C

Thereafter , I would like the sequence to go:-
42A
42B
42C
42D
42E
42F

43A
....etc until
54F

Could anyone tell me how to arrange this , please ?


B.N.
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Newbie Question on on tables

If you run a macro containing the following code, it will insert that
sequence of numbers into the cells in the first column of the table:

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


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
...
I would like to print out a table which has the sequence in descending
alphabetical order in the first column as follows:-

1A
1B
1C

2A
2B
2C

3A
..etc until

41C

Thereafter , I would like the sequence to go:-
42A
42B
42C
42D
42E
42F

43A
...etc until
54F

Could anyone tell me how to arrange this , please ?


B.N.



  #3   Report Post  
Posted to microsoft.public.word.tables
[email protected] admiral_victory@iol.ie is offline
external usenet poster
 
Posts: 6
Default Newbie Question on on tables

On Mon, 4 Dec 2006 22:43:17 +0100, "Doug Robbins - Word MVP"
wrote:

If you run a macro containing the following code, it will insert that
sequence of numbers into the cells in the first column of the table:

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



Mr Robbins ,

Thank you for the prompt reply.

However , I know nothing about running macros as I'm afraid I've
never used them before.

I have Word 2000 and have read the Help file which tells me to go to
Tools Macro Record New Macro but that's as far as I've got.

Could you tell me what to do after that, please ?

I would like to print out a page with the symbols mentioned running
down the left hand side of the page with each symbol , 1A,1B ...etc
separated from each other with a line across the page.

regards,

B.N.
  #4   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Newbie Question on on tables

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


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
...
On Mon, 4 Dec 2006 22:43:17 +0100, "Doug Robbins - Word MVP"
wrote:

If you run a macro containing the following code, it will insert that
sequence of numbers into the cells in the first column of the table:

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



Mr Robbins ,

Thank you for the prompt reply.

However , I know nothing about running macros as I'm afraid I've
never used them before.

I have Word 2000 and have read the Help file which tells me to go to
Tools Macro Record New Macro but that's as far as I've got.

Could you tell me what to do after that, please ?

I would like to print out a page with the symbols mentioned running
down the left hand side of the page with each symbol , 1A,1B ...etc
separated from each other with a line across the page.

regards,

B.N.



  #5   Report Post  
Posted to microsoft.public.word.tables
[email protected] admiral_victory@iol.ie is offline
external usenet poster
 
Posts: 6
Default Newbie Question on on tables

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.



  #6   Report Post  
Posted to microsoft.public.word.tables
[email protected] admiral_victory@iol.ie is offline
external usenet poster
 
Posts: 6
Default 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.


  #7   Report Post  
Posted to microsoft.public.word.tables
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Newbie Question on on tables

In case there's not an error in the macro but in your implementation of it,
you might see http://www.gmayor.com/installing_macro.htm, which details a
different method.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

wrote in message
...
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.



  #8   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Newbie Question on on tables

Seems like you do not have the table in the document or the selection
(Cursor) in the table. The macro also assumes that the table already
contains the required number of rows.

The macro can be modified to add the necessary rows, but it would be best to
start with at least one row in the table, which would probably be a header
row anyway. That row should contain the required number of columns and
probably the columns widths adjusted to the requirements.

The following modified macro will add the necessary rows to the table
inserting the required number in the first cell of each row. Once again,
the cursor must be in the table when the macro is run.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
...
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.




  #9   Report Post  
Posted to microsoft.public.word.tables
[email protected] admiral_victory@iol.ie is offline
external usenet poster
 
Posts: 6
Default Newbie Question on on tables

On Tue, 5 Dec 2006 19:59:19 +0100, "Doug Robbins - Word MVP"
wrote:

Seems like you do not have the table in the document or the selection
(Cursor) in the table. The macro also assumes that the table already
contains the required number of rows.

The macro can be modified to add the necessary rows, but it would be best to
start with at least one row in the table, which would probably be a header
row anyway. That row should contain the required number of columns and
probably the columns widths adjusted to the requirements.

The following modified macro will add the necessary rows to the table
inserting the required number in the first cell of each row. Once again,
the cursor must be in the table when the macro is run.


Do you mean that to have the macro you quote create the table I
requested , it is first necessary to form a table with the initial
column headings created and THEN run the macro ?

I had assumed , in my total ignorance of macros , that your code would
have created the table from scratch without any preliminary work on
the original blank document.

I'll try this and see what happens.

B.N.
  #10   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Newbie Question on on tables

Yes. I have no idea how many columns you need in the table.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
...
On Tue, 5 Dec 2006 19:59:19 +0100, "Doug Robbins - Word MVP"
wrote:

Seems like you do not have the table in the document or the selection
(Cursor) in the table. The macro also assumes that the table already
contains the required number of rows.

The macro can be modified to add the necessary rows, but it would be best
to
start with at least one row in the table, which would probably be a header
row anyway. That row should contain the required number of columns and
probably the columns widths adjusted to the requirements.

The following modified macro will add the necessary rows to the table
inserting the required number in the first cell of each row. Once again,
the cursor must be in the table when the macro is run.


Do you mean that to have the macro you quote create the table I
requested , it is first necessary to form a table with the initial
column headings created and THEN run the macro ?

I had assumed , in my total ignorance of macros , that your code would
have created the table from scratch without any preliminary work on
the original blank document.

I'll try this and see what happens.

B.N.





  #11   Report Post  
Posted to microsoft.public.word.tables
[email protected] admiral_victory@iol.ie is offline
external usenet poster
 
Posts: 6
Default Newbie Question on on tables

On Wed, 6 Dec 2006 05:44:04 +0100, "Doug Robbins - Word MVP"
wrote:

Thanks very much for your help and patience - I've sorted that out now
Much obliged

B.N.
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
Tables print distorted (vertically stretched) TC2004 Tables 0 November 22nd 06 08:05 PM
Complete newbie question Peter Brown Mailmerge 1 June 16th 06 10:53 AM
Question about tables. Frank Martin New Users 4 April 24th 06 12:29 AM
NewBie Question 2 Please Help Tom Grassi New Users 2 September 9th 05 05:03 PM
Newbie document question please Dudley Henriques New Users 4 January 9th 05 08:38 PM


All times are GMT +1. The time now is 08:17 PM.

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"