Avoiding Clipboard

Jlascu

New Member
Joined
Mar 5, 2018
Messages
11
Hi to all,

Apologies if this has been addressed before.
I've been trying to copy values from one workbook and paste them transposed on a different workbook.
The current macro using copy/paste transpose works well and does the trick, but takes forever to run.
is there a way to avoid using the clipboard?

many thanks in advance!

Jose
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi & welcome to the board.
Something like
Code:
Sub CopyTrans()
Range("L2:R2").Value = Application.Transpose(Range("K2:K8"))
End Sub
 
Upvote 0
Many thanks!! Looking forward to help in any way I can! And thanks for the help. tried it but have a few errors.
This is the code using the clipboard:

Code:
[I]                        'Copy data from[/I]
[I]                        Windows(sSPVFileName).Activate[/I]
[I]                        Worksheets("" & (a) & "").Select[/I]
[I]                        'Range(sImportRangeCopy).Select[/I]
[I]                        Range(Cells(ir1, ic1), Cells(ir2, ic2)).Select[/I]
[I]                        Selection.Copy[/I]

[I]                        'Copy data to
[/I][I]                        Windows(sDPMPName).Activate[/I]
[I]                        Worksheets("Exp").Select[/I]
[I]                        Range(sImportRangePaste).Select[/I]
[I]                        Selection.PasteSpecial Paste:=xlPasteValues, Transpose:=True[/I]

I tried many different ways with the suggestions, but none seem to work. Many thanks again!
 
Last edited by a moderator:
Upvote 0
If sImportRangePaste is a single cell, try
Code:
'Copy data from
Dim rng As Range
   Windows(sSPVFileName).Activate
   Set rng = Worksheets("" & (a) & "").Range(Cells(ir1, ic1), Cells(ir2, ic2))
   
   'Copy data to
   Windows(sDPMPName).Worksheets("Exp").Range(sImportRangePaste).Resize(rng.Columns.Count, rng.Rows.Count).Value = Application.Transpose(rng)
 
Upvote 0
Many thanks again! ... been trying several combinations, but get "Run-time error 438: Object doesn't support this property or method"
Not sure what is happening, any ideas?
 
Upvote 0
What is sImportRangePaste?
 
Upvote 0
Many thanks for all the help, you have no idea how much this is helping!!
sImportRangePaste is a string variable. it has a value of "A2" when macro is running
 
Upvote 0
What line gets highlighted, when you et the error?
 
Upvote 0
This line

'Copy data to
Windows(sDPMPName).Worksheets("Exp").Range(sImportRangePaste).Resize(rng.Columns.Count, rng.Rows.Count).Value = Application.Transpose(rng)

sImportRangePaste = "A2"
rng.Columns.Count = 26
rng.Rows.Count = 7
 
Upvote 0
Try
Code:
Windows(sDPMPName).Activate
Worksheets("Exp").Range(sImportRangePaste).Resize(rng.Columns.Count, rng.Rows.Count).Value = Application.Transpose(rng)
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

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