Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert picture automatically as "behind" not "in line with text". | Microsoft Word Help | |||
The "Symbol" under "Insert" disappeared and replaced by "Number" | Microsoft Word Help | |||
"insert text here" & "insert picture here" for templates | Microsoft Word Help | |||
Word 2003 prompts to "Delete Block?" when deleting selection. | Microsoft Word Help | |||
disable "first letter of table cells" in "AutoCorrect" with regist | Microsoft Word Help |