Quick & simple code for find value in column

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
Evening.

On my worksheet in column G I would like to search for the value PAID
I have been looking for the simplest code but keep getting diverted.
I have the code sorted for after the Then part but lost for finding the a actual value.

Need to use the xlUp code function as this will gradually be adding values down the page over time.


Basically this but the correctly written.
If value in column G = PAID Then


Thanks.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Are you looking for a formula or VBA? What should happen if PAID is found? What should happen if PAID is not found. Need some more information to get you a solution that works for you. Help us to help you by providing full details of your issues.
 
Upvote 0
If PAID isn’t present then just allow the rest of my code to continue.
If PAID is found I have a code which will delete the row.
Vba code is what I am looking for please.
 
Upvote 0
Can't help with only partial information. I'm out. Leaving it for the mind readers. Good Luck
 
Upvote 0
Perhaps something along the lines of this to search from bottom of column upwards

VBA Code:
Sub test()

Dim paidcell As Range
Set paidcell = Range("G:G").Find("PAID", , xlValues, xlWhole, xlByRows, xlPrevious, False)
If Not paidcell Is Nothing Then
    MsgBox paidcell.Row
Else
    MsgBox "PAID not found"
End If

End Sub
 
Upvote 0
Solution
Code:
If Not IsError(Application.Match("PAID", Columns(7), 0)) Then Columns(7).Find("PAID", , , 1).EntireRow.Delete
 
Upvote 0
Or even so.
Code:
On Error Resume Next
    Columns(7).Find("PAID", , , 1).EntireRow.Delete
On Error GoTo 0
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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