Copy Transpose Paste Vertically Breaking on Blanks

Thomas Hoover

New Member
Joined
Sep 10, 2019
Messages
1
I am new to VBA and coding in general. I am trying to copy/transpose/paste a two-column PivotTable and I need it to paste vertically and break on blank rows. I need to copy each group in the PivotTable and transpose paste values vertically on a new worksheet. I cannot figure out how to capture the populated rows. I am very stuck! Also, I need to determine how to paste into the next open row on the destination worksheet. I have no clue how to code this. Sample of existing code is below:

Set rng = Range("$D$2"$E$" & ActiveSheet.UsedRange.Rows.Count) ' Set range to all used rows in PivotTable

For Each cell In rng
If cell.Value = "" Then
' Found blank row --> need help selecting the group of rows between the blank row
Selection.Copy
Sheets("BH_FH").Activate
Sheets("BH_FH").Range("D2").Select
' Need to paste in the next open row below the previous paste
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
Next cell

I am stuck hard on this problem. Any assistance will be greatly appreciated! Thank you in advance!!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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