Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to automatically remove blank rows


I have an output form in a worksheet that draws selected items from
another worksheet called Master. Is there a macro that will remove any
blank rows on my output form?


--
Jack Wood
------------------------------------------------------------------------
Jack Wood's Profile: http://www.thecodecage.com/forumz/member.php?userid=346
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=100545

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default macro to automatically remove blank rows

Jack

Right click your worksheet tab, view code and paste this in and run it

Sub Sonic()
Dim i As Long
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = LastRow To 1 Step -1
If WorksheetFunction.CountA(Rows(i)) = 0 Then
Rows(i).EntireRow.Delete
End If
Next i
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub

Mike

"Jack Wood" wrote:


I have an output form in a worksheet that draws selected items from
another worksheet called Master. Is there a macro that will remove any
blank rows on my output form?


--
Jack Wood
------------------------------------------------------------------------
Jack Wood's Profile: http://www.thecodecage.com/forumz/member.php?userid=346
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=100545


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default macro to automatically remove blank rows

Sub deleterows()

With ActiveSheet
LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row

For RowCount = LastRow To 1 Step -1
LastCol = .Cells(RowCount, Columns.Count) _
.End(xlToLeft).Column
If LastCol = 1 Then
If .Range("A" & RowCount) = "" Then
.Rows(RowCount).delete
End If
End If
Next RowCount
End With
End Sub



"Jack Wood" wrote:


I have an output form in a worksheet that draws selected items from
another worksheet called Master. Is there a macro that will remove any
blank rows on my output form?


--
Jack Wood
------------------------------------------------------------------------
Jack Wood's Profile: http://www.thecodecage.com/forumz/member.php?userid=346
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=100545


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to automatically remove blank rows


Post in only one forum
Crossposting


--
Pecoflyer

Cheers -
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=100545

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
Macro to Automatically remove blank rows Jack Wood Excel Discussion (Misc queries) 4 May 26th 09 08:43 PM
How do I create a macro to remove blank rows... 1219Cookie Excel Programming 6 March 18th 09 07:07 PM
remove blank rows scolbert Excel Programming 5 January 5th 09 03:24 PM
Need macro to remove blank rows Bob Excel Programming 7 June 21st 06 01:21 PM
Remove blank rows without hiding them peter.thompson[_40_] Excel Programming 1 January 12th 06 09:38 PM


All times are GMT +1. The time now is 09:21 PM.

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"