T
Tendresse
Sorry if my post is a bit lengthy, i'll try to keep it as simple and clear as
possible.
My document is composed of a number of tables. Each table has 1 column and 2
rows: the first row has a heading and the second row has the relevant text
(body), formatted using a numbered list.
The numbered list is continuing through the tables. For example, if the
number of the last paragraph in table1 is 5, then the first paragraph in the
second row of table2 starts as number 6. And of course the numbers gets
adjusted automatically every time I add (or delete) any paragraph in any
table.
There is one blank line after each table to separate it from the following
one.
Users of that document may need to insert new tables between the exisiting
ones. These new tables should have a blank line before and after to separate
them from the surrounding ones. They should also have 2 rows and the
numbering of their paragraphs (in the second row) should continue from the
previous list.
I wrote a code to achieve that. It works very well. However, the success of
this code depends on the position of the cursor prior to running the macro.
The cursor HAS TO BE in the blank line between the tables AND right under the
second cell of the table above it. If the cursor is - for example - inside
one of the tables, or if the cursor is a few lines away from the table above
it, the macro doesn't achieve the required result.
I know that some of the users may not give any attention to the position of
the cursor before running the macro (even if I prompt them to do so using a
msgbox at the beginning of the macro). Therefore, i was wondering if there is
a way that checks the position of the cursor, and Exit Sub if the cursor is
not right under the second cell of the table above it.
Please advise if you need me to give a brief description of the code I worte.
Any suggestions will be much appreciated.
Many thanks
Tendresse
possible.
My document is composed of a number of tables. Each table has 1 column and 2
rows: the first row has a heading and the second row has the relevant text
(body), formatted using a numbered list.
The numbered list is continuing through the tables. For example, if the
number of the last paragraph in table1 is 5, then the first paragraph in the
second row of table2 starts as number 6. And of course the numbers gets
adjusted automatically every time I add (or delete) any paragraph in any
table.
There is one blank line after each table to separate it from the following
one.
Users of that document may need to insert new tables between the exisiting
ones. These new tables should have a blank line before and after to separate
them from the surrounding ones. They should also have 2 rows and the
numbering of their paragraphs (in the second row) should continue from the
previous list.
I wrote a code to achieve that. It works very well. However, the success of
this code depends on the position of the cursor prior to running the macro.
The cursor HAS TO BE in the blank line between the tables AND right under the
second cell of the table above it. If the cursor is - for example - inside
one of the tables, or if the cursor is a few lines away from the table above
it, the macro doesn't achieve the required result.
I know that some of the users may not give any attention to the position of
the cursor before running the macro (even if I prompt them to do so using a
msgbox at the beginning of the macro). Therefore, i was wondering if there is
a way that checks the position of the cursor, and Exit Sub if the cursor is
not right under the second cell of the table above it.
Please advise if you need me to give a brief description of the code I worte.
Any suggestions will be much appreciated.
Many thanks
Tendresse