Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Select text in macro
Helo
Is it possible to select a column in a table when recording a macro without scripting? I can't seem to find a way using menu/menubars... Thank you in advance. Lena |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Select text in macro
No it isn't possible. You can write code to select a column provided
the table is uniform (i.e, no split or joined cells). For example: Sub Test() Dim pMyPick As String pMyPick = InputBox("Which column do you want to select?", "Column") If pMyPick ActiveDocument.Tables(1).Columns.Count Then MsgBox "There are not that many columns in this table." Exit Sub End If If ActiveDocument.Tables(1).Uniform Then ActiveDocument.Tables(1).Columns(pMyPick).Select Else MsgBox "Sorry :-(, You can't use VBA to select a column" _ & " in a table with mixed cell width!" End If End Sub Where ActiveDocument.Tables(1) should be numbered to the table of interest in the document or used Selection.Tables(1) and put the cursor in the table before executing the macro. Bubbles wrote: Helo Is it possible to select a column in a table when recording a macro without scripting? I can't seem to find a way using menu/menubars... Thank you in advance. Lena |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use mouse to select text in MS Word macro recorder. | Page Layout | |||
Arcane Question @ Text Boxes & "Frames" | Page Layout | |||
Word applies direct format on File open | Microsoft Word Help | |||
How to select paragraph between tow specified words? | Microsoft Word Help | |||
Outline | Page Layout |