if+delete row

A

aditya

Is there any function to delete entire row if a cell is empty like this

=if(A1="",delete row1,"not empty")
 
G

Gary''s Student

This kind of action can be performed by a Macro:

Sub RowDeleter()
With Range("A1")
If .Value = "" Then
.EntireRow.Delete
End If
End With
End Sub

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
B

Bernard Liengme

A function can do one thing: it can return a value.
It cannot format, it cannot copy/paste, delete.insert, on any other Excel
feature
Do you wish to delete all rows in a worksheet when the A cell is empty?
A VBA subroutine can do this; let us know exactly what you need
best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top