paste with transpose

PeterTaylor

Board Regular
Joined
Aug 5, 2010
Messages
158
Dear all,
I am using excel 2007 need a little help with paste syntax. I have the following code
Code:
  wsData.Range(Cells(1, 15), Cells(1, myTotalColumns)).Select
        Selection.Copy
        
        
        myTotalCollarRows = wsCollars.UsedRange.Rows.Count
        myTotalCollarRows = myTotalCollarRows + 1
        
        Windows("1AAA_AL_COLLARS.xlsm").Activate
        
         
         
        
        wsCollars.Cells(myTotalCollarRows, 2).Select
        wsCollars.PasteSpecial Transpose:=True
I am trying to paste the selection with transpose option but the macro will not compile, it stops at the last line with message "named argument not found"

regards
Peter
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
change "wsCollars.PasteSpecial Transpose:=True" to
"selection.PasteSpecial Transpose:=True"
Marco compiles and runs
 
Upvote 0
If wscollars has already been previously declared as a specific sheet in that other workbook, there's no need to "activate" it, nor is it necessary to do any of that "selecting' prior to copying or pasting. This should work...

Code:
    wsData.Range(Cells(1, 15), Cells(1, myTotalColumns)).Copy
    myTotalCollarRows = wsCollars.UsedRange.Rows.Count + 1
    wsCollars.Cells(myTotalCollarRows, 2).PasteSpecial Transpose:=True
 
Upvote 0
Code:
    With wsData
        .Range(.Cells(1, 15), .Cells(1, myTotalColumns)).Copy
    End With

    With wsCollars
        myTotalCollarRows = .UsedRange.Rows.Count + 1
        .Cells(myTotalCollarRows, 2).PasteSpecial Transpose:=True
    End With
    Application.CutCopyMode = True
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,634
Members
452,934
Latest member
Jdsonne31

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top