close

I have recorded a macro, using the mouse, as folows:Sheets(quot;rep90quot;).Select
Columns(quot;GN:GUquot;).Select
Selection.Copy
Sheets(quot;rep91quot;).Select
Columns(quot;GN:GNquot;).Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

When I try to run the macro it gives an error message, highlighting columns,
to the effect that there are too many arguments on the second line of the
program. I am bemused as Excel itself wrote the procedure.

Thanks for any help

Dave Glynn

I copied the code out of your post and it ran perfectly. The problem is not
in the code, but probably in the cells.Make sure there are no merged cells in either the source or destination range.
--
Gary's Studentquot;dave glynnquot; wrote:

gt; I have recorded a macro, using the mouse, as folows:
gt;
gt;
gt; Sheets(quot;rep90quot;).Select
gt; Columns(quot;GN:GUquot;).Select
gt; Selection.Copy
gt; Sheets(quot;rep91quot;).Select
gt; Columns(quot;GN:GNquot;).Select
gt; Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
gt; SkipBlanks:=False, Transpose:=False
gt;
gt; When I try to run the macro it gives an error message, highlighting columns,
gt; to the effect that there are too many arguments on the second line of the
gt; program. I am bemused as Excel itself wrote the procedure.
gt;
gt; Thanks for any help
gt;
gt; Dave Glynn

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

    software

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