Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
JED JED is offline
external usenet poster
 
Posts: 9
Default How to insert an "X" in a selection of several cells?

Hello,
I would like to know how to insert an "X" in all cells selected in a table?
I've tried this :
Selection.TypeText Text:="X"

But this code just put only one "X" in a selection of 6 cells !!!
I'ld like to have a "X" in all 6 cells. These cells are to be selected a
differents places in the table.

Thanks for any advice.

Jed


  #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 How to insert an "X" in a selection of several cells?

Dim oCell As Cell

For Each oCell In Selection.Range.Cells
oCell.Range.Text = "X"
Next oCell


--
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

"Jed" wrote in message
...
Hello,
I would like to know how to insert an "X" in all cells selected in a
table?
I've tried this :
Selection.TypeText Text:="X"

But this code just put only one "X" in a selection of 6 cells !!!
I'ld like to have a "X" in all 6 cells. These cells are to be selected a
differents places in the table.

Thanks for any advice.

Jed




  #3   Report Post  
Posted to microsoft.public.word.tables
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default How to insert an "X" in a selection of several cells?

Doug,

I also first made a solution like yours but I found that the Xs do not
always end only where intended. For example, if you have 2 columns and select
only cells in the second column, X's will also appear in the first column
(all cells with an index number from the first in the selection to the last
in the selection will be included). This does not happen if Selection.Cells
is used instead of Selection.Range.Cells:

Dim oCell As Cell

For Each oCell In Selection.Cells
oCell.Range.Text = "X"
Next oCell

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Doug Robbins - Word MVP" wrote:

Dim oCell As Cell

For Each oCell In Selection.Range.Cells
oCell.Range.Text = "X"
Next oCell


--
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

"Jed" wrote in message
...
Hello,
I would like to know how to insert an "X" in all cells selected in a
table?
I've tried this :
Selection.TypeText Text:="X"

But this code just put only one "X" in a selection of 6 cells !!!
I'ld like to have a "X" in all 6 cells. These cells are to be selected a
differents places in the table.

Thanks for any advice.

Jed





  #4   Report Post  
Posted to microsoft.public.word.tables
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default How to insert an "X" in a selection of several cells?

Doug/Lene,

I guess I read the post as the user wanted to put an "X" in each selected
cell and those cells might be discontinuous selection. In which case
neither method seems to work and I can't offer one that does :-(



--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

"Lene Fredborg" wrote in message
...
Doug,

I also first made a solution like yours but I found that the Xs do not
always end only where intended. For example, if you have 2 columns and
select
only cells in the second column, X's will also appear in the first column
(all cells with an index number from the first in the selection to the
last
in the selection will be included). This does not happen if
Selection.Cells
is used instead of Selection.Range.Cells:

Dim oCell As Cell

For Each oCell In Selection.Cells
oCell.Range.Text = "X"
Next oCell

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Doug Robbins - Word MVP" wrote:

Dim oCell As Cell

For Each oCell In Selection.Range.Cells
oCell.Range.Text = "X"
Next oCell


--
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

"Jed" wrote in message
...
Hello,
I would like to know how to insert an "X" in all cells selected in a
table?
I've tried this :
Selection.TypeText Text:="X"

But this code just put only one "X" in a selection of 6 cells !!!
I'ld like to have a "X" in all 6 cells. These cells are to be selected
a
differents places in the table.

Thanks for any advice.

Jed







  #5   Report Post  
Posted to microsoft.public.word.tables
JED JED is offline
external usenet poster
 
Posts: 9
Default How to insert an "X" in a selection of several cells?

Hello everyone
I'ld like to thanks everyone who response.
I've tested both methods and now I'll continue working on it.
I just want to do something simple and both works well in my case.
So thanks to you all.
I'm using :
Dim oCell As Cell

For Each oCell In Selection.Cells
oCell.Range.Text = "X"
Next oCell
which works fine and I don't have any discontinous select.

Thanks a lot to u all.
My life is more easy now ;-)


"Jed" wrote:

Hello,
I would like to know how to insert an "X" in all cells selected in a table?
I've tried this :
Selection.TypeText Text:="X"

But this code just put only one "X" in a selection of 6 cells !!!
I'ld like to have a "X" in all 6 cells. These cells are to be selected a
differents places in the table.

Thanks for any advice.

Jed




  #6   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 How to insert an "X" in a selection of several cells?

Yes, it appears that Selection.Range.Cells is a range that commences with
the first selected cell and then includes every cell in the table between
that cell and the last selected cell in the same way as the cells selection
moves through the table by using the tab key.

If the centre column of a 3 column table is selected, the X gets inserted
into all of the cells except for the first one on the first row and the last
one on the last row.

--
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

"Lene Fredborg" wrote in message
...
Doug,

I also first made a solution like yours but I found that the Xs do not
always end only where intended. For example, if you have 2 columns and
select
only cells in the second column, X's will also appear in the first column
(all cells with an index number from the first in the selection to the
last
in the selection will be included). This does not happen if
Selection.Cells
is used instead of Selection.Range.Cells:

Dim oCell As Cell

For Each oCell In Selection.Cells
oCell.Range.Text = "X"
Next oCell

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Doug Robbins - Word MVP" wrote:

Dim oCell As Cell

For Each oCell In Selection.Range.Cells
oCell.Range.Text = "X"
Next oCell


--
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

"Jed" wrote in message
...
Hello,
I would like to know how to insert an "X" in all cells selected in a
table?
I've tried this :
Selection.TypeText Text:="X"

But this code just put only one "X" in a selection of 6 cells !!!
I'ld like to have a "X" in all 6 cells. These cells are to be selected
a
differents places in the table.

Thanks for any advice.

Jed







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
Insert picture automatically as "behind" not "in line with text". Taxed Mind Microsoft Word Help 8 March 29th 07 08:40 PM
The "Symbol" under "Insert" disappeared and replaced by "Number" Eling Microsoft Word Help 3 September 13th 06 03:29 PM
"insert text here" & "insert picture here" for templates New Student Microsoft Word Help 1 August 14th 06 09:26 PM
Word 2003 prompts to "Delete Block?" when deleting selection. Ohio Cube Rat Microsoft Word Help 4 April 12th 06 11:46 PM
disable "first letter of table cells" in "AutoCorrect" with regist Harald malek Microsoft Word Help 1 December 28th 05 03:36 PM


All times are GMT +1. The time now is 02:52 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"