Copy paste special transpose VBA

chef

Well-known Member
Joined
Jul 10, 2002
Messages
610
Office Version
  1. 365
  2. 2016
Hi,
I'm not that great with VBA but trying to piece together from learning on utube etc

I have a worksheet called "Pay" and and another worksheet called "Trend"

I want to copy figures and formats from "Pay" range J2:12 and then copy paste special them in the next available blank rows in "Trend" in columns D:N, but also transpose the column data in "pay" to rows in "Trend"

I've tried the following but I need to find the next blank row in "trend" and hoping this makes sense to someone.
Using O365

What I have tried but not gluing together nor fully understanding as Im not sure how to code the next available row into this

sub CopyData()
Worksheets("Pay").Range("J2:J12")
Selection.copy
Worksheets("Trend").Range(D29:N29.Select)
Selection.PasteSpecialPaste:=xlPasteValues,Transpose:=True
Application.CutCopyMode=False

End Sub

Can someone please give me a nudge in the right direction as I want to attach this to a button and just click to have updated automatically each week when the pay figures change
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
How about
VBA Code:
Sub chef()
   With Sheets("Trend").Range("D" & Rows.Count).End(xlUp).Offset(1)
      .Resize(, 11).Value = Application.Transpose(Sheets("Pay").Range("J2:J12").Value)
   End With
End Sub
 
Upvote 0
wow!!!
You made that so simple and effective.

Works a dream and thank you so much for doing this and with quick response.
Really appreciate.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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