Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I posted this before but can't find it, so here it is again.
I am trying to delete and entire row if column "A" contains "Void". Below is the code that I have written. It wigs out when I try to select the entire row. Do While ActiveCell.Value < "" If ActiveCell.Value = "Void" Then ActiveRow.Select Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
try this.. change.. activerow.select selection.delete shift:=xlup to.... Activecell.entirerow.delete shift:=xlup truthfully, i don't think there is such a thing as activerow. Regards FSt1 "Vee" wrote: I posted this before but can't find it, so here it is again. I am trying to delete and entire row if column "A" contains "Void". Below is the code that I have written. It wigs out when I try to select the entire row. Do While ActiveCell.Value < "" If ActiveCell.Value = "Void" Then ActiveRow.Select Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!
"FSt1" wrote: hi try this.. change.. activerow.select selection.delete shift:=xlup to.... Activecell.entirerow.delete shift:=xlup truthfully, i don't think there is such a thing as activerow. Regards FSt1 "Vee" wrote: I posted this before but can't find it, so here it is again. I am trying to delete and entire row if column "A" contains "Void". Below is the code that I have written. It wigs out when I try to select the entire row. Do While ActiveCell.Value < "" If ActiveCell.Value = "Void" Then ActiveRow.Select Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Right click your sheet tab, view code and paste this in. Select you data in column A and run the macro. Sub merse() For Each c In Selection If c.Value = "Void" Then c.EntireRow.Delete End If Next End Sub Mike "Vee" wrote: I posted this before but can't find it, so here it is again. I am trying to delete and entire row if column "A" contains "Void". Below is the code that I have written. It wigs out when I try to select the entire row. Do While ActiveCell.Value < "" If ActiveCell.Value = "Void" Then ActiveRow.Select Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank You - It worked
"Mike H" wrote: Hi, Right click your sheet tab, view code and paste this in. Select you data in column A and run the macro. Sub merse() For Each c In Selection If c.Value = "Void" Then c.EntireRow.Delete End If Next End Sub Mike "Vee" wrote: I posted this before but can't find it, so here it is again. I am trying to delete and entire row if column "A" contains "Void". Below is the code that I have written. It wigs out when I try to select the entire row. Do While ActiveCell.Value < "" If ActiveCell.Value = "Void" Then ActiveRow.Select Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would use this. This macro will scan down column A, starting in row 2, and
anytime a cell contains "Void" it will delete that row. You can change the Column if it doesn't fit your application. Sub DeleteRows() Dim lngRow As Long ' start on row 2, assume header in row 1 lngRow = 2 Do While Cells(lngRow, "A").Value < "" If Cells(lngRow, "A").Value = "Void" Then Rows(lngRow).Delete Shift:=xlUp End If lngRow = lngRow + 1 Loop End Sub Hope this helps! -- Cheers, Ryan "Vee" wrote: Thank You - It worked "Mike H" wrote: Hi, Right click your sheet tab, view code and paste this in. Select you data in column A and run the macro. Sub merse() For Each c In Selection If c.Value = "Void" Then c.EntireRow.Delete End If Next End Sub Mike "Vee" wrote: I posted this before but can't find it, so here it is again. I am trying to delete and entire row if column "A" contains "Void". Below is the code that I have written. It wigs out when I try to select the entire row. Do While ActiveCell.Value < "" If ActiveCell.Value = "Void" Then ActiveRow.Select Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Selection VBA code | Excel Programming | |||
Conditional Selection | Excel Worksheet Functions | |||
Specific Conditional Selection | Excel Programming | |||
Conditional Formatting and selection | Excel Discussion (Misc queries) | |||
Conditional column selection | Excel Programming |