Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have information I copy from one database from another. The rows all start
with the chassis number. There could be 30 chassis in that week. I want to have excell automatically insert a blank row between each chassis information. There are sometimes only one row of data related to that chassis and sometimes 20 or 30, never a set number. Can this be done? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"Automatic" would need VBA.
Here is a macro that inserts a row at every change in chassis number in column A Sub InsertRow_At_Change() Dim i As Long With Application .Calculation = xlManual .ScreenUpdating = False End With For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If Cells(i - 1, 1) < Cells(i, 1) Then _ Cells(i, 1).Resize(1, 1).EntireRow.Insert Next i With Application .Calculation = xlAutomatic .ScreenUpdating = True End With End Sub Gord Dibben MS Excel MVP On Thu, 17 Aug 2006 07:16:03 -0700, usdivers wrote: I have information I copy from one database from another. The rows all start with the chassis number. There could be 30 chassis in that week. I want to have excell automatically insert a blank row between each chassis information. There are sometimes only one row of data related to that chassis and sometimes 20 or 30, never a set number. Can this be done? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Gord, Thank you SO MUCH. That worked perfectly!
"Gord Dibben" wrote: "Automatic" would need VBA. Here is a macro that inserts a row at every change in chassis number in column A Sub InsertRow_At_Change() Dim i As Long With Application .Calculation = xlManual .ScreenUpdating = False End With For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If Cells(i - 1, 1) < Cells(i, 1) Then _ Cells(i, 1).Resize(1, 1).EntireRow.Insert Next i With Application .Calculation = xlAutomatic .ScreenUpdating = True End With End Sub Gord Dibben MS Excel MVP On Thu, 17 Aug 2006 07:16:03 -0700, usdivers wrote: I have information I copy from one database from another. The rows all start with the chassis number. There could be 30 chassis in that week. I want to have excell automatically insert a blank row between each chassis information. There are sometimes only one row of data related to that chassis and sometimes 20 or 30, never a set number. Can this be done? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Glad to help.
Thanks for the feedback. Gord On Thu, 17 Aug 2006 17:14:01 -0700, usdivers wrote: Gord, Thank you SO MUCH. That worked perfectly! "Gord Dibben" wrote: "Automatic" would need VBA. Here is a macro that inserts a row at every change in chassis number in column A Sub InsertRow_At_Change() Dim i As Long With Application .Calculation = xlManual .ScreenUpdating = False End With For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If Cells(i - 1, 1) < Cells(i, 1) Then _ Cells(i, 1).Resize(1, 1).EntireRow.Insert Next i With Application .Calculation = xlAutomatic .ScreenUpdating = True End With End Sub Gord Dibben MS Excel MVP On Thu, 17 Aug 2006 07:16:03 -0700, usdivers wrote: I have information I copy from one database from another. The rows all start with the chassis number. There could be 30 chassis in that week. I want to have excell automatically insert a blank row between each chassis information. There are sometimes only one row of data related to that chassis and sometimes 20 or 30, never a set number. Can this be done? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Gord Dibben,
How about inserting two rows? Please help Regards Giovs "Gord Dibben" wrote: Glad to help. Thanks for the feedback. Gord On Thu, 17 Aug 2006 17:14:01 -0700, usdivers wrote: Gord, Thank you SO MUCH. That worked perfectly! "Gord Dibben" wrote: "Automatic" would need VBA. Here is a macro that inserts a row at every change in chassis number in column A Sub InsertRow_At_Change() Dim i As Long With Application .Calculation = xlManual .ScreenUpdating = False End With For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If Cells(i - 1, 1) < Cells(i, 1) Then _ Cells(i, 1).Resize(1, 1).EntireRow.Insert Next i With Application .Calculation = xlAutomatic .ScreenUpdating = True End With End Sub Gord Dibben MS Excel MVP On Thu, 17 Aug 2006 07:16:03 -0700, usdivers wrote: I have information I copy from one database from another. The rows all start with the chassis number. There could be 30 chassis in that week. I want to have excell automatically insert a blank row between each chassis information. There are sometimes only one row of data related to that chassis and sometimes 20 or 30, never a set number. Can this be done? |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try changing
Cells(i, 1).Resize(1, 1).EntireRow.Insert to Cells(i, 1).Resize(2, 1).EntireRow.Insert Giovs wrote: Hi Gord Dibben, How about inserting two rows? Please help Regards Giovs "Gord Dibben" wrote: Glad to help. Thanks for the feedback. Gord On Thu, 17 Aug 2006 17:14:01 -0700, usdivers wrote: Gord, Thank you SO MUCH. That worked perfectly! "Gord Dibben" wrote: "Automatic" would need VBA. Here is a macro that inserts a row at every change in chassis number in column A Sub InsertRow_At_Change() Dim i As Long With Application .Calculation = xlManual .ScreenUpdating = False End With For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If Cells(i - 1, 1) < Cells(i, 1) Then _ Cells(i, 1).Resize(1, 1).EntireRow.Insert Next i With Application .Calculation = xlAutomatic .ScreenUpdating = True End With End Sub Gord Dibben MS Excel MVP On Thu, 17 Aug 2006 07:16:03 -0700, usdivers wrote: I have information I copy from one database from another. The rows all start with the chassis number. There could be 30 chassis in that week. I want to have excell automatically insert a blank row between each chassis information. There are sometimes only one row of data related to that chassis and sometimes 20 or 30, never a set number. Can this be done? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
From several workbooks onto one excel worksheet | Excel Discussion (Misc queries) | |||
Help PLEASE! Not sure what answer is: Match? Index? Other? | Excel Worksheet Functions | |||
How to match sort and lineup 2 sets of data | Excel Worksheet Functions | |||
insert data into chart | Charts and Charting in Excel | |||
Import Data: on insert, shift data down and not right | Excel Discussion (Misc queries) |