VB, Need to Delete rows
Solved/Closed
Related:
- VB, Need to Delete rows
- VB issue with delete rows with specific values ✓ - Forum - Excel
- Excel vba delete row if cell does not contain value ✓ - Forum - Excel
- How to delete rows with negative values in excel - Forum - Excel
- Visual Basic - Deleting rows in spreadsheet - How-To - Excel
- How to delete rows and columns in word - Guide
4 replies
rizvisa1
Jul 23, 2011 at 01:17 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Jul 23, 2011 at 01:17 AM
change
Or (Cell.Value) = "Inf" Then
If del Is Nothing Then _
tp
Or (Cell.Value) = "Inf" Then
else
If del Is Nothing Then
Or (Cell.Value) = "Inf" Then
If del Is Nothing Then _
tp
Or (Cell.Value) = "Inf" Then
else
If del Is Nothing Then
Thanks it works deleting those rows. But it deletes my header row 1 which I don't want it to. So, what would I add in code to prevent from deleting header row?
Thanks,
weenie
Thanks,
weenie
rizvisa1
Jul 23, 2011 at 11:06 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Jul 23, 2011 at 11:06 AM
Change
Set rng = Intersect(Range("Q:Q"), ActiveSheet.UsedRange)
to
Set rng = Intersect(Range("Q2:Q" & Rows.count), ActiveSheet.UsedRange)
Presumption is that row header is on row 1 and you want to check for deletion from row 2 on ward
Set rng = Intersect(Range("Q:Q"), ActiveSheet.UsedRange)
to
Set rng = Intersect(Range("Q2:Q" & Rows.count), ActiveSheet.UsedRange)
Presumption is that row header is on row 1 and you want to check for deletion from row 2 on ward
Sorry to bug but I am bad with counters. I'm thinking I have to use a counter of some sort because When I run the above code (corrected one) it hangs up. Iam bring in new files constantly and will have to scan again and agin to delete these new data not meeting requirement. My sheet can be large as 900,000 rows when looking for the values.
Thanks,
Weenie
Thanks,
Weenie
rizvisa1
Jul 24, 2011 at 11:48 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Jul 24, 2011 at 11:48 AM
I would suggest a different approach. Filter the values that you want to have. Then copy all the visible rows to a new sheet .