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!!
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!!