Maintaining integrity while referencing data

  • Thread starter TheBuckStoppedHere
  • Start date
T

TheBuckStoppedHere

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,
 
S

Sheeloo

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 ...
 
T

TheBuckStoppedHere

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top