Hello
I'm trying to copy and paste a certain range that needs to be pasted as a group. I've tried several things, but somehow it doesn't group the rows but the columns instead.
The code I'm using is:
Public Sub NIEUWE_RUIMTE()
Application.ScreenUpdating = False
Dim Startrng As Range
Dim Endrng As Range
Rows.Hidden = False
Rows("3:6").Copy
ActiveSheet.Shapes(Application.Caller).TopLeftCell.Offset(0, -1).Select
Do While ActiveCell.Value = "X"
ActiveCell.Offset(1, 0).Select
Loop
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Set Startrng = ActiveCell.Offset(1, 0)
Set Endrng = Startrng.Offset(2, 0)
Range(Startrng, Endrng).Group
Application.CutCopyMode = False
ActiveSheet.Outline.ShowLevels RowLevels:=1
Rows("2:7").EntireRow.Hidden = True
End Sub
It would be nice if someone could target my problem.
Bookmarks