Maintaining integrity while referencing data
I have a spreadsheet which references sequential entries from sheet 2
into a pre-arragned repeating row grouping in sheet 1. I have been asked to alter sheet 1 by inserting a new row into grouping. Is there an easy way to perform this? (There are thousands of line entries.) a b =Sheet2!C1 a b =sheet2!C2 ---------------- to ------------------------------ a b c =Sheet2!C1 a b c =sheet2!C2 Thanks in advance, -- Buck Stop |
Maintaining integrity while referencing data
Try the macro Sub insertRow() With ActiveSheet lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = lastrow To 2 Step -3 Cells(i, 1).EntireRow.Insert Next i End With End Sub Procedure to run the macro Open Excel and open the workbook/worksheet with your data Press ALT-F11 to open VB Editor Choose Insert-Module Paste the code Press F5 Swich back to the workbook and verify the data ... ------------------------------------- Pl. click ''''Yes'''' if this was helpful... "TheBuckStoppedHere" wrote: I have a spreadsheet which references sequential entries from sheet 2 into a pre-arragned repeating row grouping in sheet 1. I have been asked to alter sheet 1 by inserting a new row into grouping. Is there an easy way to perform this? (There are thousands of line entries.) a b =Sheet2!C1 a b =sheet2!C2 ---------------- to ------------------------------ a b c =Sheet2!C1 a b c =sheet2!C2 Thanks in advance, -- Buck Stop |
Maintaining integrity while referencing data
Thanks, Sheeloo!
I'll have to brush up on macros, but I can see your logic. Thanks for pointing me in the right direction This should save hours. -- Buck Stop "Sheeloo" wrote: Try the macro Sub insertRow() With ActiveSheet lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = lastrow To 2 Step -3 Cells(i, 1).EntireRow.Insert Next i End With End Sub Procedure to run the macro Open Excel and open the workbook/worksheet with your data Press ALT-F11 to open VB Editor Choose Insert-Module Paste the code Press F5 Swich back to the workbook and verify the data ... ------------------------------------- Pl. click ''''Yes'''' if this was helpful... "TheBuckStoppedHere" wrote: I have a spreadsheet which references sequential entries from sheet 2 into a pre-arragned repeating row grouping in sheet 1. I have been asked to alter sheet 1 by inserting a new row into grouping. Is there an easy way to perform this? (There are thousands of line entries.) a b =Sheet2!C1 a b =sheet2!C2 ---------------- to ------------------------------ a b c =Sheet2!C1 a b c =sheet2!C2 Thanks in advance, -- Buck Stop |
All times are GMT +1. The time now is 02:39 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com