Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default delete blank rows from other tab

hi,
anybody know a coed to delte the blank rows (row is all blank) if i'm in
other sheet. let's say i'm on sheet B and want to run a macro from sheet B to
delete blank rows from sheet A, any ideas ...??

cheers,
mayte
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default delete blank rows from other tab



These sites might help you to form a macro that will work for you.


http://www.cpearson.com/excel/deleti...eleteBlankRows

http://www.rondebruin.nl/delete.htm



"Mayte" wrote in message
...
hi,
anybody know a coed to delte the blank rows (row is all blank) if i'm in
other sheet. let's say i'm on sheet B and want to run a macro from sheet B
to
delete blank rows from sheet A, any ideas ...??

cheers,
mayte



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default delete blank rows from other tab

You will have to put this code in a standard module. Then you can put a
command button on Sheet B and call this code. I assumed your Sheet A is
named "A", if not then you will have to change the code to the correct sheet
name.

Note: This macro may run slow if you have a huge amount of data on the
worksheet. If so we will need to make this code faster by doing a Sort first
or setting the criteria to one column.

Hope this helps! If so, let me know, click "YES" below.

Option Explicit

Sub DeleteBlankRows()

Dim lngLastRow As Long
Dim lngLastColumn As Long
Dim rw As Long
Dim col As Long

' this will help speed up the macro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

With Sheets("A")

' get last row and column of used range
lngLastRow = .UsedRange.Rows.Count
lngLastColumn = .UsedRange.Columns.Count

' scan each row of used range
For rw = lngLastRow To 1 Step -1

' test each cell in row if empty
col = 1
Do While IsEmpty(.Cells(rw, col)) And col <= lngLastColumn
col = col + 1
Loop

' if all cells in rw are empty then delete row
If col lngLastColumn Then .Rows(rw).Delete Shift:=xlUp
Next rw
End With

' return app settings
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub


--
Cheers,
Ryan


"Mayte" wrote:

hi,
anybody know a coed to delte the blank rows (row is all blank) if i'm in
other sheet. let's say i'm on sheet B and want to run a macro from sheet B to
delete blank rows from sheet A, any ideas ...??

cheers,
mayte

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default delete blank rows from other tab

Brilliant !! thanks a lot mate!!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default delete blank rows from other tab

thanks!!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default delete blank rows from other tab

Click "YES" (if you see it) next to "Was thispost helpful to you?" if my
reply helped. I looking to earn my Silver Medal! :)
--
Cheers,
Ryan


"Mayte" wrote:

Brilliant !! thanks a lot mate!!


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
Delete blank rows Charlotte Howard Excel Programming 7 October 17th 08 12:26 AM
Delete Rows if any cell in Column H is blank but do not Delete Fir manfareed Excel Programming 4 September 28th 07 05:20 PM
How do I delete blank rows (rows alternate data, blank, data, etc ncochrax Excel Discussion (Misc queries) 2 June 27th 07 04:40 AM
Delete blank row only if 2 consecutive blank rows Amy Excel Programming 2 October 21st 04 05:24 PM
help delete blank rows Cletus Stripling Excel Programming 5 July 25th 03 08:47 PM


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

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

About Us

"It's about Microsoft Excel"