Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

How can I make Excel add an empty row every filled one in a list .

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Diego C. - 05 Mar 2008 22:56 GMT
Hi!
I have got a list of dates in a Excel spreadsheet with day and month in the
first column 'A' and the corresponding week day in the second column 'B'. I
obtained this list just by writing the date and week day in the first row and
then drop down the list I needed.

If I want to add row/s between the dates (so each row), since now, I have
been selecting each row manually, then right clicked and selected 'add row'.
Yet, if I have to do this hundreds of time it becomes very annoying and time
consuming.

Anybody knows if there is any formula that can be used to add one or more
rows every filled one?

Thanks!
Gord Dibben - 06 Mar 2008 02:53 GMT
Formulas cannot insert rows.

VBA can insert rows.

Sub InsertRows()
   Application.ScreenUpdating = False
   Dim numRows As Integer
   Dim r As Long
   numRows = 1
   For r = 1000 To 1 Step -1  'adjust the 1000 to a more meaningful range
       ActiveSheet.Rows(r + 1).Resize(numRows).EntireRow.Insert
   Next r
   Application.ScreenUpdating = True
End Sub

Gord Dibben  MS Excel MVP

>Hi!
>I have got a list of dates in a Excel spreadsheet with day and month in the
[quoted text clipped - 11 lines]
>
>Thanks!
Diego C. - 06 Mar 2008 10:57 GMT
Excellent it works!!

Thank you very much indeed Gord Dibben!

I did not know that something such as VBA existed before today!
Just to add what I did from someone that understand nothing about it. So
that if someone like me needs help, this is probably going to save him/her
time.

I selected the Worksheet I was working on,
I went in Tool, Micro, Visual Basic Editor
Select Insert, Module,
Once the windows opens copy and paste - just - the formula below and press
play on the top row of the Visual Basic for Application Windows.

Thanks!

> Formulas cannot insert rows.
>
[quoted text clipped - 28 lines]
> >
> >Thanks!
Gord Dibben - 06 Mar 2008 23:08 GMT
I usually add instructions for adding macros to a workbook and running them.

Apologies for my rushing and not including the instructions.

Glad to hear you got it running on your own.

Gord

>Excellent it works!!
>
[quoted text clipped - 45 lines]
>> >
>> >Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.