Find, select & delete all cells with specific value.

Liam_1988

New Member
Joined
Apr 30, 2020
Messages
25
Office Version
  1. 2013
Platform
  1. Windows
Hi everyone,

I've search through the available articles and can't find exactly what I'm looking for. I've also tried to record a macro and edit the output but nothing is working.

I'm trying to write a macro that has multiple functions.

The issue I'm facing is that my data set is basically an event log, so the amount of rows can fluctuate from set to set, but it;s always only in column A.

I want the Macro to do the following:
(1) Find, select and delete 7 different sets of cell with specific text. The first 6 only have 1 instance within the data set the 6th can have multiple instances.
(2) Find the term "Assigned" and move the cell over 1 column to the right and up 1 row (multiple instances of "Assigned" within the data set so needs to find and move all).
(3) Find any cell with only a numerical value and move the cell over 1 column to the right and up 1 row (multiple instances within the data set so needs to find and move all).
(4) Find the term "True" and move the cell over 1 column to the right and up 1 row (multiple instances of "True" within the data set so needs to find and move all).
(5) Find all cells that contain "447" and convert it to Number format to 0 decimal points.

I've managed to get the macro to action individual instances of data and select and delete them, but I'm really struggling with find the multiples.

So far this is working fine for all my single instances just by editing what it's looking for (I've obviously just changed the specific data and the numeric after "FIND_DELETE"):
Sub FIND_DELETE1()
'
' FIND_DELETE Macro
' File Import Flip 1
'

'
Cells.Find(What:="File Import Flip 1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Delete Shift:=xlUp
End Sub

I have a semi limited knowledge of VBA that is entirely self taught so please be kind Haha :)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
For clarity I'm not asking someone to write the whole thing I specifically need help with the find and select multiple cells with specific text element. The rest of the information is for context. I've written the code for all other elements :).
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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