Closed Thread
Results 1 to 2 of 2

Add/Delete rows in summary and have that replicated throughout worksheets

Hybrid View

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Beijing, China
    MS-Off Ver
    Excel 2010
    Posts
    36

    Add/Delete rows in summary and have that replicated throughout worksheets

    I'm trying to tweak some code I found that will add/delete rows on a seperate sheet when I add/delete rows in my summary sheet.

    Here's what I'm trying to use:

    Sub AddDelete()
    Dim rX As Range, rY As Range, i&
    With Sheets("Financial Statements Summary")
        Set rX = .Range("Summary_Format", .Cells(Rows.Count, 4).End(xlUp))
    End With
    With Sheets("Company1")
        Set rY = .Range("Company1_Format", .Cells(264, Columns.Count).End(xlToLeft))
    End With
    
    For i = 1 To rX.Count
        If rX(i) <> rY(i) Then
            If rX(i) <> rY(i + 1) Then
                rY(i).EntireRow.Insert
                rY(i).Value = rX(i).Value
            Else
                rY(i).EntireRow.Delete
            End If
        End If
    Next
    End Sub
    Example.xlsm

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Add/Delete rows in summary and have that replicated throughout worksheets

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Continue in this thread - http://www.excelforum.com/excel-prog...te-sheets.html

    Thread Closed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1