Question : Excel Macro to check all data in Colum A in sheet1 and delete all cells that contain that in all sheets

Hi,

Excel Macro to check all data in Colum A in sheet1 and delete all cells that contain that in all sheets.

I have a workbook that has 100's of sheets all with different sheetnames and different data
All the sheets have software list of machines in each sheet.
What i want is a way to remove all software list that are in ColumA in sheet 1.
So that i can send them the details that are unauthorized only instead of listing all the hotfixes etc.

Is there a way a macro queries the colum A find delete the data and the cell.So that there are no blanks left.

Regards
Sharath

Answer : Excel Macro to check all data in Colum A in sheet1 and delete all cells that contain that in all sheets

Okay

I missed that potential ... on first sight the macro checks column A only in teh subject sheets as well as data list.

I  now understand I need to search in columns between A and H therefere see attached, haven't actually tested it due to test sheets deletion ... but he change is small enough that it should work as expected.

Chris
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Sub delsomemore()
Dim datum As Range
Dim instance As Range
Dim ws As Worksheet
 
    Worksheets("Sheet1").Select
    For Each datum In Worksheets("Sheet1").UsedRange.Rows
        For Each ws In Worksheets
            ws.Select
            If ws.Name <> "Sheet1" Then
                Set instance = ws.Range("a1:h" & ws.Range("a" & ws.Rows.Count).End(xlUp).Row).Find(what:=datum, lookat:=xlWhole, searchdirection:=xlPrevious)
                Do While Not instance Is Nothing
                    instance.EntireRow.Delete
                    Set instance = ws.Range("a1:h" & ws.Range("a" & ws.Rows.Count).End(xlUp).Row).FindNext
                Loop
            End If
        Next
        Worksheets("Sheet1").Select
    Next
End Sub
Random Solutions  
 
programming4us programming4us