Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Leaving a blank row

Sheet 1, first 4 columns have values something like

1,a,b,c
1,a,b,c
1,a,b,c
2,a,b,c
3,a,b,c
3,a,b,c

On report -sheet 2 - I'like to have a blank row between each
different value on column A. Like below

3 rows for 1
1 blank row
1 row for 2
1 blank row
2 rows for 3

I've had no difficulty coding my report so far. But leaving these
blank rows I couldn't manage.
Any helping code snippets will be really appreciated. Thank you.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Leaving a blank row

Sub InsertRow_At_Change()
'Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim X As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False

For X = LastRow To 3 Step -1
If Cells(X, 1).Value < Cells(X - 1, 1).Value Then
If Cells(X, 1).Value < "" Then
If Cells(X - 1, 1).Value < "" Then
Cells(X, 1).entirerow.Insert Shift:=xlDown
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP


On Mon, 9 Mar 2009 11:48:13 -0700 (PDT), "
wrote:

Sheet 1, first 4 columns have values something like

1,a,b,c
1,a,b,c
1,a,b,c
2,a,b,c
3,a,b,c
3,a,b,c

On report -sheet 2 - I'like to have a blank row between each
different value on column A. Like below

3 rows for 1
1 blank row
1 row for 2
1 blank row
2 rows for 3

I've had no difficulty coding my report so far. But leaving these
blank rows I couldn't manage.
Any helping code snippets will be really appreciated. Thank you.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Leaving a blank row

On Mar 9, 9:34*pm, Gord Dibben <gorddibbATshawDOTca wrote:
Sub InsertRow_At_Change()
'Sandy Mann July 1st, 2007
* * Dim LastRow As Long
* * Dim X As Long
* * LastRow = Cells(Rows.Count, 1).End(xlUp).Row
* * Application.ScreenUpdating = False

* * For X = LastRow To 3 Step -1
* * * * If Cells(X, 1).Value < Cells(X - 1, 1).Value Then
* * * * * * If Cells(X, 1).Value < "" Then
* * * * * * * * If Cells(X - 1, 1).Value < "" Then
* * * * * * * * * * Cells(X, 1).entirerow.Insert Shift:=xlDown
* * * * * * * * End If
* * * * * * End If
* * * * End If
* * Next X
* * Application.ScreenUpdating = True
End Sub

Gord Dibben *MS Excel MVP

On Mon, 9 Mar 2009 11:48:13 -0700 (PDT), "



wrote:
Sheet 1, first 4 columns have values something like


1,a,b,c
1,a,b,c
1,a,b,c
2,a,b,c
3,a,b,c
3,a,b,c


On report -sheet 2 - *I'like to have a blank row between each
different value on column A. Like below


3 rows for 1
1 blank row
1 row for 2
1 blank row
2 rows for 3


I've had no difficulty coding my report so far. But leaving these
blank rows I couldn't manage.
Any helping code snippets will be really appreciated. Thank you.- Hide quoted text -


- Show quoted text -


Gord, thank you so much.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leaving Cell Blank Ron A.[_2_] Excel Worksheet Functions 2 October 6th 09 05:36 PM
Leaving Cell Blank. GEM Excel Worksheet Functions 3 January 20th 09 12:09 PM
Leaving a cell blank Skip cell with dates New Users to Excel 5 August 24th 08 11:18 PM
Leaving a cell blank when there is an error message - HELP mercedes Excel Discussion (Misc queries) 4 March 13th 07 08:08 PM
Leaving a cell blank. Not NA(), not "". Incoherent Excel Worksheet Functions 4 September 30th 05 05:36 PM


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"