Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey there.
I have this piece of code: Private Sub CommandButton1_Click() Dim i As Double i = 1 For i = 1 To 5850 Cells(i, 1).Select If ActiveCell.Value = Empty Then ActiveCell.EntireRow.Delete i = i + 1 Next End Sub I want this: In range A1:A5850 if cells in the first column (A) are empty then delete entire row. Exmple: A 1 5 2 3 3 4 1 It should only delete the 2 entire row. Can anyone help? With that piece of code i get an I/O error and no rows deleted... Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
http://www.rondebruin.nl/delete.htm One of this lines you can use ElseIf .Cells(Lrow, "A").Value = "" Then .Rows(Lrow).Delete 'This will delete each row if the cell is empty or have a formula that evaluates to "" ElseIf IsEmpty(.Cells(Lrow, "A").Value) Then .Rows(Lrow).Delete 'This will delete the row if the cell is empty -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "cimento cola" wrote in message ... Hey there. I have this piece of code: Private Sub CommandButton1_Click() Dim i As Double i = 1 For i = 1 To 5850 Cells(i, 1).Select If ActiveCell.Value = Empty Then ActiveCell.EntireRow.Delete i = i + 1 Next End Sub I want this: In range A1:A5850 if cells in the first column (A) are empty then delete entire row. Exmple: A 1 5 2 3 3 4 1 It should only delete the 2 entire row. Can anyone help? With that piece of code i get an I/O error and no rows deleted... Thanks, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is better
ElseIf .Cells(Lrow, "A").Value = "" Then .Rows(Lrow).Delete 'This will delete each row if the cell is empty or have a formula that evaluates to "" ElseIf IsEmpty(.Cells(Lrow, "A").Value) Then .Rows(Lrow).Delete 'This will delete the row if the cell is empty -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Ron de Bruin" wrote in message ... Try this http://www.rondebruin.nl/delete.htm One of this lines you can use ElseIf .Cells(Lrow, "A").Value = "" Then .Rows(Lrow).Delete 'This will delete each row if the cell is empty or have a formula that evaluates to "" ElseIf IsEmpty(.Cells(Lrow, "A").Value) Then .Rows(Lrow).Delete 'This will delete the row if the cell is empty -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "cimento cola" wrote in message ... Hey there. I have this piece of code: Private Sub CommandButton1_Click() Dim i As Double i = 1 For i = 1 To 5850 Cells(i, 1).Select If ActiveCell.Value = Empty Then ActiveCell.EntireRow.Delete i = i + 1 Next End Sub I want this: In range A1:A5850 if cells in the first column (A) are empty then delete entire row. Exmple: A 1 5 2 3 3 4 1 It should only delete the 2 entire row. Can anyone help? With that piece of code i get an I/O error and no rows deleted... Thanks, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cimento;
For i = 1 To 5850 Cells(i, 1).Select If IsEmpty(ActiveCell.Value) Then ActiveCell.EntireRow.Delete Next i Mark. Succes; More Excel ? www.rosenkrantz.nl or --------------------------------------------------------------------- "cimento cola" wrote in message ... Hey there. I have this piece of code: Private Sub CommandButton1_Click() Dim i As Double i = 1 For i = 1 To 5850 Cells(i, 1).Select If ActiveCell.Value = Empty Then ActiveCell.EntireRow.Delete i = i + 1 Next End Sub I want this: In range A1:A5850 if cells in the first column (A) are empty then delete entire row. Exmple: A 1 5 2 3 3 4 1 It should only delete the 2 entire row. Can anyone help? With that piece of code i get an I/O error and no rows deleted... Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to SUM entire column, but only when adjacent cell is not empty | Excel Worksheet Functions | |||
Delete an entire row | Excel Discussion (Misc queries) | |||
Delete entire row if | Excel Discussion (Misc queries) | |||
Delete Entire Row. | Excel Programming | |||
Is entire row empty? | Excel Programming |