I need to clear all the data from column C But this macro clear all the data in that row(I don't want the macro to clear the column A & column B data)
Code: Select all
Sub STEP10()
Dim wb1 As Workbook, wb2 As Workbook
Dim rg1 As Range, rg2 As Range
Dim i As Long, c As Range
Set wb1 = Workbooks.Open("C:UsersWolfieeeStyleDesktop1.xls")
Set rg1 = wb1.Worksheets(1).Cells(1, 1).CurrentRegion
Set wb2 = Workbooks.Open("C:UsersWolfieeeStyleDesktop2.xlsx")
Set rg2 = wb2.Worksheets(1).Cells(1, 1).CurrentRegion
For i = 2 To rg1.Rows.Count
If rg1(i, 19).Value Like "*[0-9]*" Then
Set c = rg2.Columns(2).Find(rg1(i, 25).Value)
If Not c Is Nothing Then c.EntireRow.ClearContents
End If
Next i
wb2.Save
wb2.Close
wb1.Close
End Sub
https://drive.google.com/file/d/1sMJWSZ ... sp=sharing
https://drive.google.com/file/d/1Ut5WgZ ... sp=sharing