Solved

Insert Copied Rows into existing Grouped Rows - VBA

Posted on 2013-11-25
1
131 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
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…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

861 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now