Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have looked on the internet and through a couple forums for code to
insert a new row in every other row of a spreadsheet, I work with a lot of data and sometimes the people above me will delete out the empty rows and it makes spacing off so i cannot copy and paste anything out of it and it gets old pasting adjusting 6000 excel rows and such.......I just need a macro that i can click on a cell and it will insert a row under it and from there down in every other row until an end row that i specify.....thanx Durst *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why do you need the empty rows?
If just for appearance, your life may be easier if you just delete them and set the row heights to double the height. But................ Sub InsertALTrows() 'David McRitchie, misc 2001-06-30 Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim I As Integer For I = Selection(Selection.Count).Row To Selection(1).Row + 1 Step -1 Rows(I).EntireRow.Insert Next I Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub Select the rows you want then run the macro using a button or shortcut key combo. Gord Dibben MS Excel MVP On Thu, 21 Jun 2007 14:15:31 -0700, VB MacroMan wrote: I have looked on the internet and through a couple forums for code to insert a new row in every other row of a spreadsheet, I work with a lot of data and sometimes the people above me will delete out the empty rows and it makes spacing off so i cannot copy and paste anything out of it and it gets old pasting adjusting 6000 excel rows and such.......I just need a macro that i can click on a cell and it will insert a row under it and from there down in every other row until an end row that i specify.....thanx Durst *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worked amazingly thanx guys.............
Durst *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you really need it something like this should do it:
Sub InsertEmptyRows() Dim r1 As Range Dim r2 As Range Dim i As Integer Set r1 = Application.Selection For i = r1.Rows.Count To 2 Step -1 Set r2 = r1.Rows(i).EntireRow r2.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Next End Sub TZS "VB MacroMan" schrieb im Newsbeitrag ... I have looked on the internet and through a couple forums for code to insert a new row in every other row of a spreadsheet, I work with a lot of data and sometimes the people above me will delete out the empty rows and it makes spacing off so i cannot copy and paste anything out of it and it gets old pasting adjusting 6000 excel rows and such.......I just need a macro that i can click on a cell and it will insert a row under it and from there down in every other row until an end row that i specify.....thanx Durst *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need simple 'Paste' macro code | Excel Programming | |||
Need a simple printing macro code | Excel Programming | |||
Could someone HELP TRANSLATE this simple psuedo code into MACRO pl | Excel Programming | |||
Could someone HELP TRANSLATE this simple psuedo code into MACRO please?! | Excel Discussion (Misc queries) | |||
Need code for Excel Simple Visual Basic Macro to select next avai. | Excel Programming |