Remove data

vijaychennai

Board Regular
Joined
Dec 7, 2009
Messages
239
Hello all,

I have excel file in the below .

Excel Workbook
AB
1ContractSplit number
2209543712.08021E+11
3209543712.08021E+11
4217480432.08022E+11
5219011882.08022E+11
6Contract2.08022E+11
7223663722.08022E+11
8223663722.08022E+11
9223994072.08022E+11
10223994072.08022E+11
11223994072.08022E+11
12223994072.08022E+11
13223994072.08022E+11
14Contract2.08022E+11
15224786442.08022E+11
16224806362.08022E+11
17224806362.08022E+11
18224806652.08022E+11
19ContractSplit number
20219920822.48322E+11
21222256552.48322E+11
Sheet1


I Need to Remove Entire data "contact"

Answer :

Excel Workbook
AB
1ContractSplit number
2209543712.08021E+11
3209543712.08021E+11
4217480432.08022E+11
5219011882.08022E+11
6223663722.08022E+11
7223663722.08022E+11
8223994072.08022E+11
9223994072.08022E+11
10223994072.08022E+11
11223994072.08022E+11
12223994072.08022E+11
13224786442.08022E+11
14224806362.08022E+11
15224806362.08022E+11
16224806652.08022E+11
17219920822.48322E+11
18222256552.48322E+11
Sheet1



Please help me give VBA Code.

Thanks
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try

Code:
Sub atest()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
    If Range("A" & i).Value = "Contract" Then Rows(i).Delete
Next i
End Sub
 
Upvote 0
Something like:

Code:
ActiveSheet.Range("A:A").AutoFilter Field:=1, Criteria1:="Contract"     Rows("2:2").Select     Range(Selection, Selection.End(xlDown)).Select     Selection.Delete Shift:=xlUp     ActiveSheet.Range("A:A").AutoFilter Field:=1

should work, even though its not the pure VBA route. Hope this helps.
</pre>
 
Upvote 0

Forum statistics

Threads
1,214,534
Messages
6,120,080
Members
448,943
Latest member
sharmarick

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