A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to insert an "X" in a selection of several cells?



 
 
Thread Tools Display Modes
  #1  
Old December 4th, 2007, 02:39 PM posted to microsoft.public.word.tables
JED
external usenet poster
 
Posts: 34
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  
Old December 4th, 2007, 08:02 PM posted to microsoft.public.word.tables
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
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  
Old December 4th, 2007, 08:19 PM posted to microsoft.public.word.tables
Lene Fredborg
external usenet poster
 
Posts: 1,294
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  
Old December 4th, 2007, 09:26 PM posted to microsoft.public.word.tables
Greg Maxey
external usenet poster
 
Posts: 290
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  
Old December 4th, 2007, 10:03 PM posted to microsoft.public.word.tables
JED
external usenet poster
 
Posts: 34
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  
Old December 4th, 2007, 10:33 PM posted to microsoft.public.word.tables
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
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







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.