Solved

Insert Copied Rows into existing Grouped Rows - VBA

Posted on 2013-11-25
1
136 Views
Last Modified: 2014-06-30
I just started using Excel 2010 and am running into a problem I did not encounter in 2007.  For my Report, I am grouping a list of rows together.  At the end of the vba automation, I am inserting copied row cells into that group by using "Insert Copied Cells" which are an entire row.  When I do this, however, It breaks the group up into two right at the insertion point.  Is there a way to stop this from happening?  

One solution would be to wait to group the cells after the inserted rows are in place, but this will require a re-write of my vba coding.  Is there an option to turn on or off?  VBA solution is best answer, but open to other suggestions.
InsertCopiedRowIntoGroupedRows.jpg
0
Comment
Question by:pdkolmo
1 Comment
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39674376
Hi,

if you use a partial row like this, you shouldn't have problem to insert it

    myRow = Selection.Row
    myColumn = Selection.Column
    Set myRange = Range(Cells(myRow, myColumn), Range(myRow, Columns.Count).End(xlToLeft))
    

Open in new window

Regards
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question