Solved

Insert Copied Rows into existing Grouped Rows - VBA

Posted on 2013-11-25
1
128 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 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

19 Experts available now in Live!

Get 1:1 Help Now