ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do I add rows to a very large spreadsheet (https://www.excelbanter.com/excel-worksheet-functions/29857-how-do-i-add-rows-very-large-spreadsheet.html)

excelmam

how do I add rows to a very large spreadsheet
 
I have an excel question. I have a huge spreadsheet that I need to insert two
blank lines after every two lines. Then I need to insert a formula on those
two blank lines.
Does anyone know how I might save time and complete this task w/o adding it
in manually after every two lines.

Harald Staff

Hi

This is what a macro does. But you'd need to know how to write a macro that
does this. Or have someone else write it. But this person would need an
awfully detailed description of this task., like which row numbers, what is
in the cells where, which exact formula should go where and why, ... If you
can describe this, post it in microsoft.public.excel.programming for
suggestions.

HTH. Best wishes Harald

"excelmam" skrev i melding
...
I have an excel question. I have a huge spreadsheet that I need to insert

two
blank lines after every two lines. Then I need to insert a formula on

those
two blank lines.
Does anyone know how I might save time and complete this task w/o adding

it
in manually after every two lines.




dominicb


Good evening Excelmam

Good news and bad news. The good news is, inserting two blank lines
after each line is pretty easy. The formula bit isn't. The code below
will take a block of data 150 lines long and add two blank rows after
each line, making it 450 lines long. You haven't given much info here,
so I don't know how many lines you are trying to work on:

Sub Test()
For f = 1 To 150 Step 2
Rows(f).Select
Selection.Insert Shift:=xlDown
f = f + 1
Rows(f).Select
Selection.Insert Shift:=xlDown
ActiveSheet.Paste
Next f
End Sub

The code is a little bit messy I know, but for a one off job it will do
the trick. I'll have to think a bit harder about the formulae bit, but
you'll need to supply more information, like what the formulae are
going to be, how many, etc...?

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=377562



All times are GMT +1. The time now is 07:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com