Find and Delete Rows...Noob to Excel

CuriousEW

New Member
Joined
Jul 27, 2011
Messages
6
I have reviewed all the posts, and found the VBA code to be very confusing when finding and deleting rows with a specific value. I am very new and could use some guidance.

The value of "Valassis Inc" I want to find are in one column. I want to delete the rows containing this value and clean up the deleted rows once complete.

Is this possible for someone with NO VBA experience? If not, where can I read up on VBA code?

Thank you.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
The code would be like this

Code:
Sub DVAL()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
    If Range("A" & i).Value = "Valassis Inc" Then Rows(i).Delete
Next i
End Sub
 
Upvote 0
Welcome to the Forum,

Try this

Sub test()
Dim LastRow As Long, i As Integer

LastRow = [A65536].End(xlUp).Row
For i = LastRow To 1 Step -1
If cells(i, 1) = "Valassis Inc" Then Rows(i & ":" & i).EntireRow.Delete
Next i
End Sub
 
Last edited:
Upvote 0
Since the value I am looking for was in Column R, I changed "A" to "R" and all worked well. Couldn't get it to run with "A" in the LR value and IF statement. Not sure if this was the best practice, but it seemed to do the trick.

Thanks to all who offered guidance!!!

I am sure you will hear from me again :P
 
Upvote 0

Forum statistics

Threads
1,224,578
Messages
6,179,654
Members
452,934
Latest member
mm1t1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top