#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default delete row


If cell A4 has a value of 0. I am looking for the entire row to be
deleted.
Please help:( :(


--
mikespeck
------------------------------------------------------------------------
mikespeck's Profile: http://www.excelforum.com/member.php...o&userid=34946
View this thread: http://www.excelforum.com/showthread...hreadid=564434

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default delete row


You will need VBA Code

Try this. Press Alt + F11. Insert module then paste in the below code.
Press alt F8 and run Delete_row.

See attched to make it a event procedure e.g If someone enters 0 in
cell A4 it will delete row automatically

http://www.cpearson.com/excel/events.htm

Sub Delete_row()

Dim Rng1 As Range
Set Rng1 = Range("A4")

If Rng1.Value = 0 Then
Rows("4:4").Delete Shift:=xlUp
End If

End Sub

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=564434

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27
Default delete row

or:
in VBA:
Sub row()
If Range("A4").Value = 0 Then
Selection.EntireRow.Delete
ActiveCell.Offset(RowOffset:=-1, ColumnOffset:=0)
End If
End Sub

"VBA Noob" wrote in
message ...

You will need VBA Code

Try this. Press Alt + F11. Insert module then paste in the below code.
Press alt F8 and run Delete_row.

See attched to make it a event procedure e.g If someone enters 0 in
cell A4 it will delete row automatically

http://www.cpearson.com/excel/events.htm

Sub Delete_row()

Dim Rng1 As Range
Set Rng1 = Range("A4")

If Rng1.Value = 0 Then
Rows("4:4").Delete Shift:=xlUp
End If

End Sub

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile:
http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=564434



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default delete row


nothing seemed to work.
If a 0 is in A4 I need to at least have the contents of cells
A4,B4,C4,D4,E4,F4 be deleted also.




--
mikespeck
------------------------------------------------------------------------
mikespeck's Profile: http://www.excelforum.com/member.php...o&userid=34946
View this thread: http://www.excelforum.com/showthread...hreadid=564434

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
I can't delete a cell without deleting a row Tenny Excel Discussion (Misc queries) 2 June 30th 06 12:52 AM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
how do I delete a worksheet from my workbook DLee New Users to Excel 2 August 15th 05 09:59 PM
In a protected worksheet allow users to delete rows Jason Trivett Excel Worksheet Functions 1 July 12th 05 09:50 AM
Delete row depending on criteria adw223 Excel Discussion (Misc queries) 1 June 30th 05 12:55 AM


All times are GMT +1. The time now is 04:58 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"