close

A beginner's question:

I am trying to insert a column into col position 2 in a table, which
apparently is to be done with the following code:

ActiveDocument.Tables(1).Columns(1).Select
Selection.InsertColumnsRight

However, when I run the macro, the object quot;Activedocumentquot; is empty.
What is wrong here?
Thanks!--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile: www.excelforum.com/member.php...oamp;userid=33789
View this thread: www.excelforum.com/showthread...hreadid=541836I think you want the Word groups, this is Excel.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

quot;LauraBorealisquot; gt;
wrote in message
news:LauraBorealis.27r95a_1147539002.9499@excelfor um-nospam.com...
gt;
gt; A beginner's question:
gt;
gt; I am trying to insert a column into col position 2 in a table, which
gt; apparently is to be done with the following code:
gt;
gt; ActiveDocument.Tables(1).Columns(1).Select
gt; Selection.InsertColumnsRight
gt;
gt; However, when I run the macro, the object quot;Activedocumentquot; is empty.
gt; What is wrong here?
gt; Thanks!
gt;
gt;
gt; --
gt; LauraBorealis
gt; ------------------------------------------------------------------------
gt; LauraBorealis's Profile:
www.excelforum.com/member.php...oamp;userid=33789
gt; View this thread: www.excelforum.com/showthread...hreadid=541836
gt;

Oh, great. So the code I found isn't even for Excel, but for a table in
a Word document? I'll have to pay more attention to the environment
when code comes back from an MSDN search. (Why isn't Microsoft
consistent across platforms...)--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile: www.excelforum.com/member.php...oamp;userid=33789
View this thread: www.excelforum.com/showthread...hreadid=541836
To insert a column to the right of the presently selected cell:

ActiveCell.Select
ActiveCell.Offset(0, 1).Select
Selection.EntireColumn.Insert
ActiveCell.Offset(0, -1).Select--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile: www.excelforum.com/member.php...oamp;userid=33789
View this thread: www.excelforum.com/showthread...hreadid=541836ActiveCell.Offset(0, 1).EntireColumn.Insert

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

quot;LauraBorealisquot; gt;
wrote in message
news:LauraBorealis.27t26y_1147623302.108@excelforu m-nospam.com...
gt;
gt; To insert a column to the right of the presently selected cell:
gt;
gt; ActiveCell.Select
gt; ActiveCell.Offset(0, 1).Select
gt; Selection.EntireColumn.Insert
gt; ActiveCell.Offset(0, -1).Select
gt;
gt;
gt; --
gt; LauraBorealis
gt; ------------------------------------------------------------------------
gt; LauraBorealis's Profile:
www.excelforum.com/member.php...oamp;userid=33789
gt; View this thread: www.excelforum.com/showthread...hreadid=541836
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()